Keep in mind that they work fine on the second page. There are 3 levels of grouping pertaining to P & L statements. First group is broken into 2 categories (straight from table structure) the categories are: Gross Margin and Total Expenses. Group 2 (straight from table structure) are subcategories of Group 1 For example: Total Sales, Total COS, ect. Group 3 are the accounts that belong to each of the Group 2 Categories. Values for each account is grabbed at this level (and are correct) and summed in each of the other grouping levels. The details section of this report contains the following formula:
Code:
shared stringvar CPname;
shared stringvar CP1name;
shared stringvar CP2name;
global numbervar cp1period;
global numbervar cp2period;
if {Periods.Period_Num} = {?Fiscal Period} then
CPname := {Periods.Period_Name};
if {Periods.Period_Num} = cp1period then
CP1name := {Periods.Period_Name};
if {Periods.Period_Num} = cp2period then
CP2name := {Periods.Period_Name};
The CPname, CP1name, and CP2name are the names for the relevant periods - like 'January'. The {Periods.Period_Name} field is in this format straight from the tables.
the periods.period_num data is a regular integer number between 1 and 12. The parameter {?Fiscal Period} is also a integer number between 1 and 12.
In the page header of the report, I have several headings that consist of the following formula (substituting CP2name, cp2year with relevant vars from the details):
Code:
shared stringvar CP2name;
global numbervar cp2year;
CP2name & " F" & right(totext(cp2year,0,"",""),2)
The only page header that works on the first page, is the one that consists of the period that the user selected. For example if I selected period 2 (which for us is 1 month ago) Then I get the correct header (on the first page) which reads:
'October F'06'
On the second page, I get all headers? So if the user selects fiscal year = 6, fiscal period = 2, then 2 headers should read backward from this parameter,
'August F'05' 'September F'05' then the current one (which works on page 1) 'October F'06'. If I make the font small enough for the entire report to fit on one page, then the only heading that works is the parameter heading. When the headings don't work, I get:
'F'05', 'F'05', 'October F'06'
Does this make things more clear?