Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Overide parameters in Sub Report: Post Reply Post New Topic
Author Message
Esc2Xtc
Newbie
Newbie
Avatar

Joined: 03 Aug 2007
Location: United States
Online Status: Offline
Posts: 3
Quote Esc2Xtc Replybullet Topic: Overide parameters in Sub Report:
    Posted: 03 Aug 2007 at 12:50pm
Hey guys,
 
I had a bit of a hiccup with Crystal Reports X, was hoping someone in here had an answer to. Tried looking for my case online but wasn't able to come up with anything. If this has already been posted can you please direct me to the link? Thanks!
  • I have one main report (Report1) and two sub reports (Report2 & Report3).
  • The reports are supposed to filter out information based on certain criteria.
  • They all pick information from the same table but through three different stored procedures at the moment (each has different recordset values based on different conditions).
  • The backend is sql server 2000 thought this could be any data source and I think irrelevant.
  • All three reports have completely different design structures, but the user does not want to print them as separate jobs but as a single document.
  • At the moment I am not looking at calling it from any specific front-end / programming language, just going into Crystal Reports X and clicking on Preview.
  • User required information (parameter definition) will be the same for all three reports viz
    • Zone name (West, East, etc)
    • Week for which report will be previewed (From and To Date)
  • What changes is a parameter "Bank Name" which is not user prompted but rather to be harcoded for each report.
My questions are as follows:
 
#1. Is it possible for me to define the above user prompted parameters in the main report and somehow have these values picked up by the child subreports?
 
At the moment if I define them in all three, while previewing the report, the prompt for information appears thrice for each parameter.
 
#2. If I define header information in the main report, these headers also replicate when the subreports are viewed. Does this mean that I should infact have four reports, the parent headers being blank, and the three child reports will then have their individual headers? Can I disable parent headers the moment the subreports start to print such that the child headers will go into effect?
 
#3. Is it possible for me to pass a default hardcoded parameter value with the report?
Example: besides the two standard user prompted parameters for all three reports, each report passes a distinct "Bank Name" value based on which each report displays its different information (defined in the report design structure). Since I know what each report is supposed to display, say Report1 = Bank Name A, Report2 = Bank Name B, Report3 =
Bank Name C, I would like to hardcode the parameter to go out with the report query rather than have the user enter this. In this case I could have just a single stored procedure instead of multiple stored procedures extracting different recordset values based on different default report parameter set above.
 
If any more clarifications are required let me know.
 
Appreciate any help you can give me.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 03 Aug 2007 at 1:32pm
Wow. I think this is the best written post I've ever seen. Here are some comments for you.

#1. This gets asked periodically here so I added it in the "Best of the Forums" section in my new book. The problem you are seeing is because when you link to the subreport, you are linking to a parameter that CR creates in the subreport (called PM-xxx). You don't want to link to this parameter. Instead, click on that drop down back and specify the parameter you want to link to directly. It's like 'eliminating the middle man'. Having that PM-xxx parameter will cause mulitple prompting to occur.

#2. Of course the header information in the main report will replicate across the subreports. A subrreport is just a section within the main report and the main report will always print its header info. Suppress them if you don't want them to appear. Unfortunately, subreprorts can't have a page header (but they do have report headers to go on the first page). If you want page headers you have to create a dummy group.

#3. To hard-code parameters in the subreport, create formulas in the main report that are constants. Then link a subreport to the appropriate formula. This mimics hard coding the parameter by letting the main report pass on the data rather than the user entering it.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Esc2Xtc
Newbie
Newbie
Avatar

Joined: 03 Aug 2007
Location: United States
Online Status: Offline
Posts: 3
Quote Esc2Xtc Replybullet Posted: 06 Aug 2007 at 5:49pm
Thanks Brian for the quick reply,
 
Let me try what you've mentioned and give you a status update as soon as I'm done.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.032 seconds.