Skip to Content
0

Crystal 2013 Shared Variable is not passed to first row on all pages after the first page.

Mar 30, 2017 at 11:33 PM

100

avatar image

I have a shared variable in a detail row that is passed to an on demand subreport. However, the shared variable is not being passed to the subreport when it appears in the first row of the second page. It is being passed when it appears on the second row of the second page. This actually is happening on every first row of every page after the 1st page. I have tried moving around the formula that creates the shared variable (putting it before the row, after the the row, even in the detail row). Nothing is working. If I cannot get this to work, I'm afraid that we will be switching to SSRS, which doesn't have these kinds of issues.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

8 Answers

Best Answer
Deanna Rider Mar 31, 2017 at 04:52 PM
0

I'm re-doing the report. I do not trust Share Variables at this point.

Share
10 |10000 characters needed characters left characters exceeded
Ian Waterman Mar 31, 2017 at 07:13 AM
0

Try splitting the detail section into two, place variable formula in top section and subreport in lower section. Suppress top section.

Ian

Share
10 |10000 characters needed characters left characters exceeded
Deanna Rider Mar 31, 2017 at 02:01 PM
0

I did that already. I also tried placing the varable in the lower section. It didn't work.

Share
10 |10000 characters needed characters left characters exceeded
Vitaly Izmaylov
Mar 31, 2017 at 02:43 PM
0

You mentioned "OnDemand" subreport.

Does it work if the subreport is not OnDemand?

Share
10 |10000 characters needed characters left characters exceeded
Ian Waterman Mar 31, 2017 at 02:49 PM
0

Do have repeat groupheader on new page checked?

This can sometimes upset the action of variables. Try turning off

Ian

Share
10 |10000 characters needed characters left characters exceeded
Brian Dong Mar 31, 2017 at 06:42 PM
0

Hi Deanna,

If you want to re-visit this, I'd like to have a look at the formula on the Main Report and the formula on the subreport and where on the subreport you placed the formula.

Thanks,

Brian

Share
10 |10000 characters needed characters left characters exceeded
Deanna Rider Mar 31, 2017 at 07:28 PM
0

I have changed the report. Frankly, I do not find shared variables every reliable.

Share
10 |10000 characters needed characters left characters exceeded
Deanna Rider May 02, 2017 at 09:10 PM
0

I now have this happening on a report that has 46 on-demand subreports so I am not looking forward to changing all variables to parameters that can be passed.

The main report formula is:

WhilePrintingRecords;

numberVar CMS2_Cnct;

shared stringVar s_CMS2_desc;

shared numberVar s_CMS2_d;

shared numberVar s_CMS2_n;

shared numberVar s_CMS2_except;

shared numberVar s_CMS2_excl;

shared numberVar s_CMS2_score;

If {Command.QM_ID} = 90019482 then

( CMS2_Cnct := {Command.SUM_QM_CNCT_NUM};

s_CMS2_desc := {Command.RECORD_NAME};

s_CMS2_n := {Command.QM_NUMERATOR};

s_CMS2_d := {Command.QM_DENOMINATOR};

s_CMS2_except := {Command.QM_EXCEPTIONS};

s_CMS2_excl := {Command.QM_EXCLUSIONS};

s_CMS2_score := score({Command.SCORE}) );

The subreport formulas are basically this:

whileprintingrecords;

Shared NumberVar s_CMS2_d

The main report formulas are in Detail A and the subreports are in Group Footer 4.

I have had this problem on another report also with multiple combinations where the main formulas were in Detail A and the subs were in Detail B. I also tried with both on the same Detail line.

It makes no sense that it would not pass data to the first line on the second page and each subsequent page. It does pass to the second line and all others on the page.

Share
10 |10000 characters needed characters left characters exceeded