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

Page Header Fields Can Vary in Report

Status
Not open for further replies.

brendamg

Programmer
Joined
Aug 12, 2003
Messages
5
Location
US
The report that I'm developing requires a range of year fields in the page header and detail section, controlled by the user's input. The range of years are never the same. The report must be flexible to handle the various years. Where do I write the code for both the header and detail section to reflect the various years requested by the user in the access form which must be passed to the report ? I will also have to tell it where to put the labels on the page header. The user will input a starting fiscal year and an ending fiscal year; i.e. FY89 - FY91. The report must have a page header and a detail field for each year beginning with 89 thru 93.
Testing Special Problem
ITEM FY Component Qty FY89 FY90 FY91 Total

Radio 9 xx-3010 45 85.00 0.00 100.59 185.59

The next time the report is run the user may want FY 91 - 92. All of the fields are standard except the FY fields.
 
This:

"Where do I write the code for both the header and detail section to reflect the various years requested by the user in the access form which must be passed to the report ?"

Sounds like an MS Access question, not Crystal.

Here's the example apps for VBA and Access:


I'm not sure what "range of year fields in the page header and detail section" means.

You want the range to display in those sections, or you intend to filter rows, and coincidentally, they should filter in these sections as well as others?

You also state year fields, so you have different year fields, or different years within a field?

You can display parameter ranges using:

minimum({?parm})+" - "+maximum({?parm})

You filter rows using:

Report->Edit Selection Formula->Record

{table.field} = {?parm}

-k
 
I guess my question wasn't clear. I have generated all of the data for this report from ACCESS 2000, into a table. When I create a standard report with Crystal Reports, I will have some standard labels in the page header and I will have some label that will have to be generated because the start and end fiscal year dates can vary. I need to add these labels to the page header following the standard labels that are permanently there. I know that a parameter will have to be passed from the access form to crystal reports. My question is how do I write the code to create the additional headers from the data passed in the parameter?
 
You could try the following for the page header labels:

//{@year1} to be placed in the page header:
if year(minimum({?date})) <= year(maximum({?date})) then
year(minimum({?date}))

//{@year2}:
if year(minimum({?date}))+1 <= year(maximum({?date})) then
year(minimum({?date}))+1

//{@year3}:
if year(minimum({?date}))+2 <= year(maximum({?date})) then
year(minimum({?date}))+2 //etc.

Format each formula to suppress if = 0.

For the data columns, you could use formulas like:

//{@year3result}:
if year(minimum({?date}))+2 <= year(maximum({?date})) then
if year({table.date}) = year(minimum({?date}))+2 then {table.field}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top