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

Error generating data for a subreport

Status
Not open for further replies.

vatawna

Programmer
Feb 24, 2004
67
US
I'm using CR9 and SQL Server 2000. The main report and the on-demand subreport are grouped by:

1. Yearly
2. Quarterly
3. Monthly
4. Date
5. Department
6. Resource

Each one of the groups above is a formula. The main report is thus linked to the subreport based on those groups.

The problem is, the subreport shows correct data for all months in Quarter 2, but it doesn't show any data for any month in Quarter 3. When I clicked on a resource in, for example, July on the main report, the generated subreport is blank. But the file "subreport.rpt" does have data for that month.

Does anyone know what the problem is? Thanks.
 
How can you verify that the subreport has data when the on demand shows it does not?

It sounds like your links are wrong.

Try pasting in your Report-Selection Formulas->Record for the Main and subreport (this shows linking).

-k
 
I know the subreport file "subreport.rpt" has data for all months, because I open that actual file and see it there. The record selection formula is as follows:

({APPTMSTR.APPTDATE} >= "20040401") And ({APPTMSTR.APPTDATE} <= "20040731")

where APPTDATE is between 4/1/2004 and 7/31/2004, which will generate data for 2nd quarter and 3rd quarter.

The formula for Quarterly is:

stringVar ApptMonth1 := Mid ({APPTMSTR.APPTDATE}, 5, 2);

If {@StringToDate} In Calendar1stQtr Then
"Q1"
Else If {@StringToDate} In Calendar2ndQtr Then
"Q2"
Else If {@StringToDate} In Calendar3rdQtr Then
"Q3"
Else If {@StringToDate} In Calendar4thQtr Then
"Q4"
Else (
If (ApptMonth1 >= "1") And (ApptMonth1 <= "3") Then
"Q1"
Else If (ApptMonth1 >= "4") And (ApptMonth1 <= "6") Then
"Q2"
Else If (ApptMonth1 >= "7") And (ApptMonth1 <= "9") Then
"Q3"
Else
"Q4"
)

and the one for Monthly is:

stringVar ApptMonth2 := Mid ({APPTMSTR.APPTDATE}, 5, 2);

If (ApptMonth2 = "01") Then
MonthName (1)
Else If (ApptMonth2 = "02") Then
MonthName (2)
Else If (ApptMonth2 = "03") Then
MonthName (3)
Else If (ApptMonth2 = "04") Then
MonthName (4)
Else If (ApptMonth2 = "05") Then
MonthName (5)
Else If (ApptMonth2 = "06") Then
MonthName (6)
Else If (ApptMonth2 = "07") Then
MonthName (7)
Else If (ApptMonth2 = "08") Then
MonthName (8)
Else If (ApptMonth2 = "09") Then
MonthName (9)
Else If (ApptMonth2 = "10") Then
MonthName (10)
Else If (ApptMonth2 = "11") Then
MonthName (11)
Else
MonthName (12)


Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top