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!

Fixed Length on SubReport 1

Status
Not open for further replies.

Barock21

MIS
Dec 27, 2005
23
US
I need to create a fixed length flat file. Unfortunately, part of the information is from a subreport. I tested this and export it on a .csv file and the subreport information is not showing on the .csv file. Is there a way for me to get around this?

Thanks in advance.
 
Maybe, but you need to take the time to post your software version, where thwe subreport is, and what the format of the subreport is.

A CSV file means that you have a single data source, not multiples, which is what subreports tend to provide.

You might consider returning the values from the subreport using shared variables and placing those in the main report to emulate a single datasource.

-k
 
I currently am using crystal 8.5 but can use version 11 if need be. All the subreport has is just 1 line count of number of sales. I did the formula to make it fixed length text on the subreport. Can you please elaborate on how to return value from the subreport to the main report? This may be a way out. Thx.
 
Here's the formula I did on the subreport:

NumberVar RequiredLength:= 9;
NumberVar CurrentLength:= Length (TOTEXT ({#BID Count}, "0000000000"));
IF RequiredLength < CurrentLength

THEN TOTEXT ({#BID Count}, "0000000000") [1 TO RequiredLength]

ELSE ReplicateString ("0",RequiredLength - CurrentLength) + TOTEXT ({#BID Count}, "0000000000")
 
To pass data back from a subreport, use a shared variable. For a date, put a formula field in the subreport like
Code:
Shared dateVar 
V_Today := {LoadStatus.LastDLoad}
To access it in the main report, create another formula field with
Code:
Shared dateVar 
V_Today := V_Today

If it was a currency value, you'd do it differently, e.g.
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved:={#TotSaved};
SumSaved
And to access it in the main report, create another formula field with
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved

Note that the shared variable is only available in the section after the section which contains the subreport.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top