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

Problem passing parameter if no data exists

Status
Not open for further replies.

jeffm777

IS-IT--Management
Nov 10, 2009
108
US
I'm building a report to show 4 years worth of data (current year, 1 year ago, 2 years ago, and 3 years ago). I'm using multiple classes that don't link so I'm using subreports and shared variables. For this particular report, there is no data in one of the classes for the month of November for any of the 4 years so therefor, no data is showing on the report. This is causing a problem when I try and pass the shared data to the subreports because the subreports are looking for 12 months of data but only 11 exist, thus causing "A subscript must be between 1 and the size of the array".

Is there a way for Crystal to look and see if any data exists for each month/year and if not, add a 0?

Let me know what data I need to provide to assist. Tks.
 
i think you should be able to create a formula in your subreport that evaluates the data and then if there is none pass a zero up otherwise pass up the data value, then use the formula in the shared value instead of the field.

{@PassUp}
IF isnull({yourtable.yourfield}) OR TRIM(totext({yourtable.yourfield})
THEN 0
else {yourtable.yourfield}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top