0
votes

I have a Crystal Reports rpt-file, that contains 2 queries. (One for the main report, and the other for the subreport.) The user gives a parameter ("DocNum") for the main report, that connected with a key field ("DocEntry") to the subreport.

enter image description here

The problem is, that in this case it takes too long time to generate the report, because the Crystal Reports reads the all records to the memory, and just than creates the rpt-file.

Query of the main report:

SELECT DocNum, DocEntry, CardCode FROM OINV WHERE DocNum = {?DocNum}

Query of the subreport:

SELECT ItemCode, Dscription FROM INV1

Is there any solution, that passing the key fields value ("DocEntry") to the subreports query as a "where condition"?

Something like this:

SELECT ItemCode, Dscription FROM INV1 WHERE DocEntry = {...}
1

1 Answers

0
votes

Yes, this is known as Linked subreport. Right-click the subreport and select 'Change Subreport Links...'