Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to pass date parameter from the main report

Status
Not open for further replies.

Hm786

Programmer
Apr 5, 2001
88
US
Hi,

My report has a main report and 3 sub reports. I need to pass the enddate parameter to all the 3 sub reports. Right now when the user prompts every time the 3 endate parameters for the 3 sub reports pop up. Is there a way to make the enddt as a shared variable and pass to the sub reports? I tried to create a shared datevar p:= enddate and called this variable in my sub reports but nothing is showing. Can anybody help me in this problem?


Thanks,
Hamida
 
It's simpler than that, don't create parameters in the subreports.

Link the parameter in the main report to the date field in the subreports.

Go into the subreport and edit the Report->Edit selection formula->Record so that it properly uses the date (it will have a default of =), since this is an enddate, you'll probably want to use a < instead of the = that it will default to.

-k kai@informeddatadecisions.com
 
Dear HM786,

If you do want to use your parameters in the subreport here are the steps:

In your subreport create parameters with the same name as in the main report.

Right Click on the subreport. Change Subreport Links

In the top left pane, choose your date parameter(s) and move to the right pane (Field to Link To).

Now, in the bottom left hand pane there is a dropdown arrow. When you click it, it actually displays a spinner scroll box, just beneath the drop down arrow. This is if you have subreport parameters; but it is so tiny[\b] that most don't notice (Very Poor Gui Design). Scroll down and select your parameter.

Now, double check your select statement in the subreport and make sure it is correctly using the subreport's parameters.

You should be golden.

ro


Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Dear SV,

Hi long time.... This works and only prompts you the one time. You just make sure to get rid of those pesky ?PM's reference the subreport's parameter - they are linked and it works like a charm.

I do these all the time.... and it works and only prompts once I promise promise...

ro
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Hey ro, it has been a while, have you been traversing the world again?

OK, I thought that this resulted in getting prompted in some cases so I avoid it by coding around them, thanks for the clarification.

-k kai@informeddatadecisions.com
 
Hey SV,

Yeah I guess I missed you when you were in NY..

I have been so busy - working 20 hr days... haven't had the time for tek-tips that I like to devote.

Going to Baltimore next week, Vancouver week after...

Business is up this year so grabbing all that I can before it disappears into the ether.

How are you?

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Rosemary and SV,

Thanks for your advice. It is working fine for me and not prompting for the parameters 3 times. But the parameter is passing to the where caluse. I don't want the where caluse changed. Only reason I am using this parameter is creating gl balance and debit/credit based on this date value. I can't ristrict the report with this parameter. That's why I am creating seperate subreports to get data not based on the where clause. But my main report has the data restricted to that end date. I am just using this parameter value to calculate the formulas.


Thanks,
Hamdia
 
Dear HM786,

If the point is to just use the value from main report in the subreport create a formula in the Main Report as follows (before the subreport):

//PassEndDate
shared datevar mydate;
mydate := {?YourDateParameterEndDate}


In the subreport create a formula:

//ReceivePassedEndDate
shared datevar mydate:

mydate

That will pass the value the Links are for only that - Linking!

ro


Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Dear Rosemary,

I tried the same thing before and also tried again using your exact syntax but I am not getting the date it shows true or false (boolean)values. I need to show the date so my formula can take the month from the parameter and calculate the gl values.

Thanks,
Hamida
 
Rosemary,

It is working now I put the variable top of the sub report and now the date values are showing instead of boolean. First time I might have placed after the sub reports. Thanks again.

Hamida

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top