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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Values Passing Between Supreports 1

Status
Not open for further replies.

pandi

Programmer
Dec 12, 2001
22
0
0
MY
In my main report I am having 13 supreports. I want to know whether I can suppress the whole subreport based on any subreport value? I want to change the numbering of hte supreports dynamically whether I can do it or not.

Pandi
 
Hi,

In the first sub report create an formula

WhilePrintingRecords;
Shared numberVar num := 0;
if somecondition then
num := 1

In the main report create a formula

WhilePrintingRecords;
Shared numberVar num;

place this formula below the section where the sub report is placed

link the main report formula to a parameter in the second sub report

use the parameter and create a formula in the second sub report

WhilePrintingRecords;
Shared numberVar num2 := {?param};
if somecondition then
num2 := {?param} + 1

In the main report create a formula

WhilePrintingRecords;
Shared numberVar num2;

continue the same process

Sudarshan
 
I don't think that will work.

What are your subreports returning??? Single values??

The easiest way you handle that is to have the subreports return shared variables (or shared variable arrays) instead of displaying the result themselves.

Make all the lines of the subreport suppressed so that while it passes back a shared value...it will not show up in the report...(NOTE: for a subreport to execute...it must be on a non-suppressed line of the main report ... you cannot even conditionally suppress the main report section )

Since the subreport is designed for calculation and not display it can be made as small as you like in the main report....I always color-code them with a conditional background color in the format of the subreport on the main report...something like (if 1 = 1 then crNoColor else crRed)
placed in the conditional suppress will make it easy to find these subreports in design mode

Hope this helps you

Jim
 
I wrote a short article in my newsletter about a "stealth" subreport. You might find it helpful if you need a subreport to run, but want it to be invisible.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top