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

Shared string variables in subreports

Status
Not open for further replies.

LisaJ5

Vendor
Oct 27, 2005
1
GB
I have a letter and I want to run the report to read Your catchments school is school A or school B. or your catchments school is school A. The main report is looking at the first preference and I have created a sub report looking at the second preference using a shared string variable. How do I change the report to have an 'or' if two schools are displayed and a full stop after the second preferences or a '.' at the end of the first preference?
 
Please tell us the fields and information in these fields you are looking at.

I suggest using a formula to simply combine the field value and . {field} & '.' to get your dot behind a preference.

Need more information on what you get from your database to give a better answer though
 
Best to do this in sub report.

Is catchment limited to two schools?

If yes in subreport create shared string var catch1.

Use these to capture school names from detail lines

In subreport header
@reset
whileprintingrecords;

global number var n:= 1;
shared stringvar catch1:=''


whileprintingrecords;

global number var n;
shared stringvar catch1

If n = 1 then catch1:= {Schoolnamefield}&'.';

if n= 2 then catch1:= catch1&' or '&catch1;

n:=n+1;

Ian




In report foot
 
I have a shared string var in a subreport sitting in the group header which is being used in the group footer along with the rest of my titles. It pulls the correct information but it creates a blank line (above where the subreport link is sitting) when exported.

I've tried to suppress the group header to eliminate this issue but then the subreport doesn't run. If I place it in the footer along with the other fields it shifts the generated values down one line.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top