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!

Subreport Parameter not working

Status
Not open for further replies.

Simon9999

Technical User
Oct 25, 2006
105
GB
Hi all,

I am using Crystal Reports Xi and have a problem with subreports and parameters.

I am passing a date from a main report to a sub report which shows when things have been approved. This works fine in general. However when the main report does not contain any data but the subreport does, the sub report does not show anything even though when you run the subreport seperately, the data shows.

Any suggestions?
 
If there is no data, this usually means a null. Nulls always cause Crystal to stop.

What are you passing to the subreport? Maybe you need a formual field with something like
Code:
if isnull({your.date}) 
then currentdate 
else {your.date}
Pass this as the parameter and it should be fine. But check the report selection in your subreport to see what it's got.

It also depends on where your subreport is - report header or footer, I'd assume. It a section is not printed then a subreport in that section is not run.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks for this.

I am passing a parameter that I specify when running the report e.g. 09/05/07 and therefore the parameter itself cannot be null. I guess the field it is trying to slect must count as null if there are none that match the parameter.

However I cannot use the above formula as I need to specify a particluar date such as 09/05/07 so cannot use current date. Any ideas how I could get round this?

Cheers
 
If you pass a parameter that you've entred, that should be OK. Try my other two suggestions - in particular, check the subreport record selection. It probably contains something you've not allowed for: subreport linking posts there automatically.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Did you figure out this problem? Because I'm having the same issue... it appears to be a problem with the linking, because if I don't link the parameters and specify them manually, the subreport runs correctly...but then I link the parameters and it doesn't... my case is the same where there are no nulls because they are parameters I am specifying in the parent report manually, I just want to link them down to the subreports because the use them as well... I am out of ideas on how to fix this problem. Any suggestions would be greatly appreciated..
 
What is the main report linked to, the parmeter, or the main reports date field?

You probably should have started a new post,including your software used and version, the database, and specifics.

-k
 
Note that if there is no data in the main report, the subreport will not appear. You could consider whether you could make the subreport the main report--if the current sub always has data and the main report sometimes doesn't.

-LB
 
Hello
Not sure if this applies to your issue but there is a known issue with CRXI R2 where the islinked property of the subreport parameter always evaluates to False.

This was corrected recently with SP2 as noted below:

ADAPT00276500 Patch ID: 39,481,760
Description:
In the Crystal Reports .NET SDK, the ParameterFieldDefinition.IsLinked property always returns false, whether or not a parameter is linked to a subreport.
New Behavior:
This problem is resolved.

The SP is available at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top