Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Your site is a great idea. I should have joined your site years ago. Better late than never..."

Geography

Where in the world do Tek-Tips members come from?
n2nuk (IS/IT--Management)
29 Jun 12 10:47
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



hilfy ( IS/IT--Management)
29 Jun 12 11:10
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
www.decisionfirst.com

lbass (TechnicalUser)
30 Jun 12 10:17

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
n2nuk (IS/IT--Management)
4 Jul 12 11:58
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.
lbass (TechnicalUser)
5 Jul 12 7:05
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

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close