Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreport Parameters Post Reply Post New Topic
Author Message
Ballboy1
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 11
Quote Ballboy1 Replybullet Topic: Subreport Parameters
     Posted: 27 Jul 2010 at 11:18pm

Hello all,

 

Sorry if this has already been discussed, I couldn’t find a topic.

 

I have a parameter select on my subreport that sets the formatt. For some reason (user error prob :)) the sub parameters are displayed at the bottem on the main report parameter dialog box. Then once that dialog box as been closed, another loaded with the sub report parameters (still on the main report here). Finally once thats been closed and I click on the subreport link the parameter box correctly loads on the sub report.

 

 

Is there any way to remove the sub report parameters from the main report parameter lists. And on the same line, remove the extra dialog box.

 

If this is clear as mud just say.

 

Thanks,

 

BB



Edited by Ballboy1 - 27 Jul 2010 at 11:19pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jul 2010 at 3:53am
Create the parms you need for your sub report once in the main report then make them into a formula field then pass the formula (e.g. converted param) to the sub report as a link.
This way you do not use any sub report params at all


Edited by DBlank - 28 Jul 2010 at 3:54am
IP IP Logged
Ballboy1
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 11
Quote Ballboy1 Replybullet Posted: 28 Jul 2010 at 5:18am

Thanks for the reply,

 

That isnt really what I require... in effect the reverse. I have a main report with a list of data eg companys in a fully layed out crystal report. At the end of each row there is a butten that loads a subreport with drilled down information ie, the products that the company has brought.

 

When the user selects to view the information i need a parameter to select what formatt they want the subreport to be displayed in. A nice printable crystal report of the products for that company OR a 'download' formatt. IE very basic for export to excel for example.

 

Hopfully you can see I really need the pram at the subrep call, no when they open the main report (which already has its own parm which with other things asks if they want the main report in a 'download' view.

 
This 'works' but for the odd concat of the main/sub prams when loading the main report and  subrep parm dialog displaying whenever you do anything within the main rep.
 
I cant find a solution to that... so im here picking the brains of you fine people LOL

 

BB



Edited by Ballboy1 - 28 Jul 2010 at 5:54am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jul 2010 at 6:46am
I do not think you can do this. the sub-report params are called at the time the main report is generated.
If you do not want the user to make the determination at main report run-time I think the easiest solution would be to make 2 subreports next to each other (of the same data), one for viewing, one for exporting. Buiild them slight different to meet the needs but then they can run what they want by picking the report buuton rather than getting a 'pop up'
IP IP Logged
Ballboy1
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 11
Quote Ballboy1 Replybullet Posted: 28 Jul 2010 at 9:42pm

I feared as much. Good work around. I'll carry on trying for a fix over the next day or two and leave this topic to see if someone has a trick / work around. Failing that, i'll take your advice and change to the dual system.

 

Thanks again for the reply.

BB

IP IP Logged
Ballboy1
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 11
Quote Ballboy1 Replybullet Posted: 29 Jul 2010 at 7:06am
I've hit another challange with theparam work around. Again ive looked around but cant fine any similer questions
 
Is it possible to pass a formula field holding a static string to a subreport to act as a kind of trigger? Im trying to use one subreport instead of the two you adviced. Looking to pass a Download trigger to use in the section supression formula. ie) if @download = "download" true
 
Where there is a @download with the string "download" within in the main rep and link that to an empty @download formula feild in the subrep which will change to "download" once the formula from the main report has been passed
 
 
 
So is it possible?
 
Thanks again,
 
BB


Edited by Ballboy1 - 29 Jul 2010 at 7:07am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jul 2010 at 7:57am

You can create a shared variable in the main report

assign it = the param value
hen create that same shared variable in the sub report and use the value for your suppression criteria
Make sure to place the shared variable in the mauin report header to create it before you try have to pass it in a lower section of the main report.
IP IP Logged
Ballboy1
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 11
Quote Ballboy1 Replybullet Posted: 29 Jul 2010 at 9:28pm

Shared Value works great. it passes a trigger to the sub report.

But that trigger is activted when the regurlar sub report is activatied. Is there anyway of setting up an If subreport link is clicked then set the shared Var...
 
The problem stems from the fact the 2 sub links point to the same sub report. what I need is if the second sublink is loaded, activate a trigger (in this case a shared Var) that is read in the sub report to change the format.
 
As it works now the shared value is passed to both meaning the supression is always true.
 
Any work around?
 
BB


Edited by Ballboy1 - 30 Jul 2010 at 1:39am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2010 at 3:16am
I don't think so. You can edit the sub reports independently of each other, but that means maintaining 2 versions of it.
IP IP Logged
Ballboy1
Newbie
Newbie


Joined: 27 Jul 2010
Online Status: Offline
Posts: 11
Quote Ballboy1 Replybullet Posted: 02 Aug 2010 at 1:11am
I've fixed the problem (Kind of, not sure its a feature or a bug ive used :P )
 
I have passed over a formula feild that holds the value "download" but with no reciving param or feild as a parm would cause the problem discusesed at the start of this topic or would requre a new colum in the basetable / view just for this crystal report... pretty much a no no.
 
So I was sneeky and tried to hardcoaded the temp param {?Pm-@download) into a supression formula.
 
I tried this before but it kept on removing the temp param feild as i think crystal saw it was being a none exsistant feild (its not there is you open up the sub report on its own). I think this was becasue there is no solid join, just a passing link from the main rep.
 
However I found out of you open and edit the sub report by double clicking the sublink IE) the embedded version on the main rep design view it aways sets the ?Pm feilds even tho it hasnt been "executed".
 
That way i can edit without the fear of the temp value being dropped.
 
 
Its a fix so long as no-one ever opens the sub-rep .rpt via the open file option :).  Tho can I delete the .rpt of my subrep now its been "embedded"? I dunno but anyway
 
bug.. feature.... bug.... feature :) it works so im taking it to be a feature.
 
Thanks for all the help DBlank
 
BB


Edited by Ballboy1 - 02 Aug 2010 at 1:28am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum