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

Supress shared variable data in main report

Status
Not open for further replies.

n2nuk

IS-IT--Management
Dec 24, 2002
190
GB
Hi there,

I am returning a string variable from a subreport on my main report. when the row is null it is returning the data from the previous section.

The subreport formula is ex_worker:

whileprintingrecords;
shared stringvar ex_worker := {HISTORY.workerid}

on my main report I have added a new section under the existing group header, GH1b where I have a formula: shrd_ex_worker

whileprintingrecords;
shared stringvar ex_worker

This works OK except where there is no ex worker in which case it returns the ex_worker id from the previous row. Is there any way I can suporess this or reset the variable so that it runs for each row.

Many thanks



 
Change the formula in the subreport to something like this:

whileprintingrecords;
shared stringvar ex_worker;
if IsNull({HISTORY.workerid}) then ex_worker := ''
else ex_worker := {HISTORY.workerid};
ex_worker

This should return a blank string when the field is null and the correct worker id when it's not.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 

You haven't said in what report section the sub is lcoated, but you should add a reset formula in a section_a (if the sub is in section_b). The section_a can be suppressed.

whileprintingrecords;
shared stringvar ex_worker;
if not inrepeatedgroupheader then
ex_worker := "";

-LB
 
I have applied the code that hilfy has suppled and this has worked a treat,

Lbass - on my main report all the fields are in the group header (GH1a) including the sub.
the data from the shared variables is in a separate section below the group header (GH1b)

Not sure where to apply the code you have supplied should it go in the sub report on the main report?

ideally I want to hide the sub that is in GH1a, but will end up with data on two separate rows instead one single line.
 
Put it in the GF1. You can't hide or suppress the sub directly, but you can make it disappear. This assumes you are using CR 9 or above.

You should move all fields to GH1b, leaving only the sub in GH1a. Then select the sub->right click->format sub->sub tab->check "suppress blank subreport". Then within the sub, suppress all report sections. In the main report->section expert->GH1a->check "suppress blank section".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top