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

Formula value shows up in next row instead of inital row

Status
Not open for further replies.

lthomas6

MIS
Aug 22, 2007
87
US
I have a report which has several columns. The first column has a subreport to calculate reserve. The second column has a subreport to calculate cost. There is a third column in the report that calculates the value. So it has a formula which = reserves - costs.

The issue I am seeing is that the formula calculates the information correctly, but for some reason it starts with a zero and then the correct calculation starts on the next row. Would you know why it is doing this?

the formula is set to:
whileprintingrecords;
{@Reserv_total} - {@cost_total}

@cost_total = shared NumberVar cost_tot
@reserv_total = shared NumberVar reserve_tot

This is Crystal 10 with SQL database.
 
Try splitting the section holding the subreports into two parts

PLace subreports in top section and main report data in lower section.

In Section expert for top section check underlay following sections.

The problem you are seeing is a result of the order in which crystal execute report, run main report data first then subreports. By moving SRs into upper section it forces them to run first.

Ian
 
Not sure if I am understanding your response.

The current layout of the report is one in which the column headings are in teh page header and the values for these fields are in the Group Header.
In the subreport for Reserve, the value is placed in the report footer. In the subreport for cost, the value is placed in the report footer.

what are you suggesting?
 
Does not matter where the subreport data is.

As I suggested split the group header into two sections and place SRs in top section etc.

Ian
 
Do have slight issue though. I have 2 other columns that also are subreports so by doing the above, it now pulls no values for these other two subreports. Any suggestions whY?
 
What do they do and how do they relate to the main report or other Subreports.

Ian
 
Nevermind, if i place those 2 reports in a separate group header section and underlay, it solves the problem. Issue resolved. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top