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

Subreport Problem

Status
Not open for further replies.

pamgdevlin

Programmer
Nov 24, 2003
14
US
I'm working in Crystal 8.5 grouping and summing the historical quantities of products for specific months and my main report looks like this:

JAN FEB MAR APR MAY JUN
380005 123 555 76 678 55 99

Since July data is in a different table, I'm using a subreport to add July to my report by linking the product code fields. My problem is that if there is data for a particular product code in the main report, but not in the subreport, I get a blank which hinders my ability to create a grand total. I tried to create a formula in the subreport to enter a zero if the field was null, but it wouldn't work. (see below)

IIF (isnull(Sum ({ARTRS31.FSHIPQTY}, {ARTRS31.FITEMNO})),0 ,Sum ({ARTRS31.FSHIPQTY}, {ARTRS31.FITEMNO}) )

If anyone has any suggestions, I'd really appreciate it.
 
You must be creating the group sums for July, Aug, etc., with shared variables if you intend to total them, so in the main report, try inserting a reset formula for each month in the group footer (or in a group header section above where the subreport is executed) like:

//{@Julyreset}:
whileprintingrecords;
shared numbervar Julysum := 0;

...where Julysum is something like the following formula in your subreport:
whileprintingrecords;
shared numbervar Julysum := sum({@Julyamt},{table.group});

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top