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

Subreport bombing out CR8.5

Status
Not open for further replies.

awaywifye

Programmer
Jul 1, 2004
24
0
0
US
Quick background. 90% of the reports I write are fed their data from a VB program with a SQL DB. So I write the queries, use the program for the parameters and pass the results to the report. 10% I actually use Crystal's linking/parameters.

The report uses 2 tables. The first has a listing of assets (UID, model, description, barcode). The second table is a listing of each time the asset was inventoried. I have 2000 rows in the first table (2000 pieces of equipment a group is responsible for) and about 5000 rows in the second table.

Table 1
UID Model Descript. Barcode
1 10001 Mouse M101
2 10001 Mouse M102
3 198820 Keyboard K101
4 199820 Keyboard K120

Table 2
Table1UID RecordUID Date By
1 1 07-09-04 User1
3 2 07-09-04 User1
4 3 07-09-04 User1
1 4 09-01-05 User1

Here's the catch. As Items are inventoried, they are added to table 2. So, in the example above, Barcode M102 wasn't inventoried in 7/9/04 (might have been lost).

My report has a parameter asking the user for the date (from table2) they wish to run the report for. The information in table 2 (date and by) is displayed in a subreport if exists.

If the report was run for 7/9/04 it would show:
Model Descript. Barcode Date By
10001 Mouse M101 07-09-04 User1
10001 Mouse M102
198820 Keyboard K101 07-09-04 User1
199820 Keyboard K120 07-09-04 User1

The problem is that the subreport is going to line 1, quering 5000 records, going to line 2, quering 5000 records, etc, etc.. This causes it to die a horrible death after the 1st page.

Any suggestions?
 
What is the subreport linked on, and what section is it in?

It would seem that you want to group the main report on the Model and Barcode, and place the subreport in the Barcode footer, linking by both fields.

Not sure that you need a subreport at all, and they are generally a BAD idea.

-k
 
Sorry about that:

Group#1 - Model(suppressed)
Group#2 - Barcode
Row is placed in group#2 header.

The subreport has 2 links:
Table1.UID = Table2.Table1UID
and
?ParameterDate = DATE{tDate}
 
The subreport has 1 group of Tree1UID

Informaton is placed in the Details.


I tried a group of tDate and placing the information in the group header, but wound up with similar results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top