Zo Has
Zo Has

Reputation: 13038

Pass shared variable from main report to crosstab?

I want to pass shared variable in main report to a subreport's crosstab formula field ? How do I do this ?

If I declare a shared variable inside main report and try to access it in the subreport's crosstab with 'whilereadingrecords' it just won't get anything.

Upvotes: 1

Views: 1573

Answers (1)

PowerUser
PowerUser

Reputation: 11801

I made a mock report and came up with this solution:

  • Make a formula in your main report. Enter this code:
whileprintingrecords;
shared numbervar foo:=3;
foo
  • In your subreport, make a formula. For this example, call it MySharedVar. Enter this code:

shared numbervar foo

  • In your subreport, make a second formula. Call it MySharedVar2. Enter this code:

MySharedVar

  • Use the MySharedVar2 formula in your crosstab as normal.

Upvotes: 2

Related Questions