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

Displaying count of detail records in Record Header

Status
Not open for further replies.

JanetStackpole

Programmer
Sep 30, 2005
24
US
Hello,

I am using CR 9 with MS SQL. I am writing a report that creates a flat file to be uploaded for billing. I have created the individual record strings, but am having trouble with the header line. In this line I need to include the total file dollar amount and the total number of individual records. I cannot figure out how to do this since the report header appears before the individual records. I have tried using shared variables with no success. Any suggestions would be greatly apprecieated.

Here is an example layout

Report Header
000DASGSD01TOTAL_DOLLAR_AMOUNT00TOTAL_NUMBER_OF_RECORDS
DETAIL SECTION
001DAS01RECORD_NUMBER00LINE_ITEM00DOLLAR_AMOUNT
001DAS01RECORD_NUMBER00LINE_ITEM00DOLLAR_AMOUNT
 
Create a formula that uses a recurring field one that cannot be null--let's call it {table.ID}. Go to the field explorer->formula->new and enter:

count({table.ID})

Place the formula in the report header.

-LB
 
Thanks lbass. That worked for the count. Any suggestions for calculating the total file dollar amount? This report contains two sub reports that pass the dollar amount for each detail record to the main report. As expected, it displays correctly for each detail record. As I stated earlier, I am using shared variables to gather the dollar amounts. It works if I place the formula in the report footer. But when in the header it returns zero.

Report set up:


REPORT HEADER
000DASGSD01TOTAL_DOLLAR_AMOUNT001

GROUP HEADER - SUPPRESSED

DETAIL SECTION - subrepots are located here. fields are supressed in each subreport.

GROUP FOOTER - contains detail record
001DAS01RECORD_NUMBER00LINE_ITEM00DOLLAR_AMOUNT
001DAS01RECORD_NUMBER00LINE_ITEM00DOLLAR_AMOUNT
 
The only way you will get the info in the report header is to place copies of the subreports in a report header section and either display only the sub report footer which contains the desired display or pass the value to a shared variable displayed in a lower report header section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top