views:

29

answers:

1

Hi I am trying to have a master detail report. But the report always crashes as i hit the next page on the preview. Both the queries work fine in the query editor.

Main report query

select a.Name,a.ftid,a.instno from testschema.ViewA a where a.ftid={?ftid}

Shared variables declared in main report separately

shared numbervar instno;
instno:={Command.INSTNO}

shared stringVar gnpidesc;
gnpidesc:={Command.Name}

Sub report query

select a.TOTALAMT,b.Name from  testschema.ViewB a CROSS JOIN testschema.View3 b where a.ftid={?ftid} AND  b.ftid=a.ftid AND  b.instno={?instno} AND a.Name='{?gnpidesc}' ORDER BY a.GENGNPIDESC

Shared variables declared inside subreport header separately

shared numbervar instno;
shared stringVar gnpidesc;

I have delcared 3 parameters fields also with the same name.Sub report only shows for first row in master, if I click next page the application crashes.

Edit The Sub report contains a cross-tab report in the sub report head section. Report Layout

Main Report
 - Details Section (Main report query)
 - Details Section2 (Sub report)
 - Cross-tab (Sub report Footer- Query 2)
Main Report
+1  A: 

I'm certain I've seen this before with my own reports. You probably have some data quality/consistency issues.

  1. Do any of your joining fields have a null value? All it takes is 1 record ;)

  2. Do you have a formulae that references a field with a null value?

  3. I don't know what your data source is, but do any of those views have custom formulae that Crystal wouldn't recognize? For example, I often pull data from MS Access queries, but Crystal throws an error if I use the nz() function.

  4. One way to find your culprit is to scroll through your preview until you find the page that can't display and crashes. See what data would have displayed on there.

You'll have to either fix the data before it gets to Crystal or rework a function. Good luck.

PowerUser
thank you I filtered the records from crystal report 'change subrepot links' rather then passing variables to sub report.
Popo