views:

19

answers:

1

Hi I want to store sub report fields per page into an array and print that array inside the report footer in main report. Any clue guys ?

A: 

If you're talking about only a few fields, then I'd recommend a shared variable taking the data back to the main report.

If it's alot of data, then you should make another subreport in the main report's footer and calculate all your data there.

Edit

Well, you asked, so here's how:

  1. In your main report's footer, create a formula (call it FooMain) with this code:

    whileprintingrecords;
    shared stringvar MyLittleVar;

  2. In your subreport, create a formula (call it FooSub) with this code:

    whileprintingrecords;
    Shared stringvar MyLittleVar:="This is from the subreport";

  3. Preview your report. In the footer, the FooMain formula should display "This is from the subreport". Use FooMain in whatever calculations in the main report. Due to fundamental design aspects of Crystal, this will only work if FooMain (and any formulas that reference it) is below the subreport it is getting data from.

PowerUser
There are a lot of fields. I did used the shared variable but I could not pass that shared variable to the cross tab report in the main report's footer. Any clue ?
Popo
whoa. I was about to type up a step-by-step list, but i see now you want to share an entire *field* between the 2 reports, not just a single data point. IMHO, you'd be best off just making a subreport for your main report's footer.
PowerUser
Hi I would like to see what you had in mind. By lot of fields I mean not all ( about 10 of them from the 1st sub report).
Popo
See my Edits above. As I was saying though, this is only good for single data points (i.e. the summary of a field, like Total Sales). After all, Crystal was built for *displaying* data, not complex analytics.
PowerUser