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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Losing shared variable on drill down

Status
Not open for further replies.

ToastyinVA

Programmer
Sep 27, 2000
16
US
Crystal 8

I have a subreport placed in the report header of the main report with a shared variable declared. In the page header I can display the shared variable with no problem so I know I am getting the data from the subreport. However, when I drill down I lose the shaired varaible - the value is blank. Why??? I had previously imported the same subreport at each group header to get the value I seek which worked but I would like to just use 1 subreport and share the value in the rest of the main report. Seems like it should be easy but it drops the value everytime. PLease Help!
 
Just to clarify - I have put the shared variable in each group header - it is blank on every drill down.
 
I got the same result and found the following in the Crystal KB

The Shared Variables pass data correctly from the subreport to the main report. However, the Shared Variables pass data incorrectly from the main report to the subreport.

For example:

When creating shared variables using the 'Shared' function in Crystal Reports:

· Subreport -> Main report = correct shared variable values

· Main report -> Subreport = incorrect/null shared variable values

To resolve this issue you must obtain the following product update from our website at:


For Crystal Reports version 7, download the following file:

sr867_7011b_setup.zip

You should note that when you install this patch, Crystal Reports 7 build version will become version 7.0.100.4.

For Crystal Reports version 8, download the following file:

Sr858_8010c_setup.zip

Once you have downloaded the patch, read the Readme file to successfully install it.

You should note that when you install this patch, Crystal Reports 8 build version will become version 8.0.0.395.
 
I read that too but I am not passing anything back to the subreport so I don't think that is the problem (plus that is for Crystal 7 and I am using 8). I pull the data from the subreport and then use it throughout my main report (with drill down). The variable is blank at each group header expect for the page header (so I know I am getting the data). I import the subreport at the report header. I'm wondering if it has anything to do with the way I am supressing headers and footers.
 
It was for 7 and 8 but I see the other issue. It's not your suppression though because I didn't supress anything and I get the same result. I thought it might be due to the object not actually being in the main report but if you put a sub itself there, it stays on drill-down - could you use that as a work-around? You could both pass the value (for any calculation) and display it too? I'll look some more too.
 
I originally had the subreport at each header and it worked, however I had to change my way because for some reason Crystal would not drill down on the report past the first level from the desktop - ODBD is causing the problem but I don't know why. I did another report with the subreport at each level (not using ODBC) and it worked fine. So I was trying to just pull the ODBD subreport in once and pass the variable and use it throughout - I guess Crystal must initialize variables after pages or something. I'm stumped.
 
Hi ToastyinVA,

I guess i am having same problem what said in the first post, I am placing the subreport in reportHeader and getting the values in First Level of DrillDown, When i clcik on it, the vlaues are set to ZERO, which is not right,If you let me know little more on this,

I am using CR10,SAP Native Connection.

Thanks for the Help,
Venu
 
Hi ToastyinVA,

I got it,with what you said in the last post,

Thanks for the Help,
Venu
 
Hi All,

My subreport is unlinked one and will pull almost 500000 records, if i am placing in header level it is taking quite long time and i guess it will run for the each group as it generates in main report, so this will take few hours i guess.Is there any other way that i can get the values in drill downs from subreport,

Thanks for the Help,

Venu
 
Hi All,

Can any one help me in this,

CR 10.

Thanks,
Venu
 
To get more responses, please start a new thread, instead of building on a very old one. Describe your current report structure, the content of the subreport, how it is linked to the main report, and why you feel you need to use a subreport in the first place. From your various posts, it is unclear whether your subreport is placed in the main report report header or in a group header.

Variables will lose their values during drilldown. There might be a different approach if you supply more information.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top