Print Page | Close Window

Sub Report Parameter based on Primary Report

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21486
Printed Date: 27 Apr 2024 at 10:19pm


Topic: Sub Report Parameter based on Primary Report
Posted By: Erik
Subject: Sub Report Parameter based on Primary Report
Date Posted: 14 May 2015 at 9:53am
We have a document imaging system where I wrote a QA report which gives a list of document batches for a particular day, and lists any page count discrepancies between the source system (scan) and the destination system (storage).

I also wrote a separate QA report where staff take any batch numbers with page discrepancies from the first report, and punch them in to get at the individual document details within the batch, where as the first report is overall batch details only.

I've been able to automate the first report, and it's been requested that I somehow automate the second report based on the results of the first.

----------

Here are some ways I've considered going about this. If anyone has any suggestions for which would be the best, or if there are better ideas I would be very happy to hear them.

1) Create a subreport and pass the results from the first report as Parameters to the subreport. The part that makes my head spin here is that the subreport may need to be run multiple times for multiple values.

2) Create a new report, not a subreport, take the formula that produces the values I want from the first report, and place it into the Select Criteria of this report.

What makes this especially tricky is that my primary report is a SQL Command that joins 2 different databases. So I'm not sure how feasible it would be to translate this into Select Criteria.



Replies:
Posted By: Erik
Date Posted: 18 May 2015 at 6:42am
I'm thinking it would be cleaner to do this all in SQL since both reports were creating using SQL Commands.

In talking to my DBA we are going to see if we can JOIN the two reports on Batch Number so that the second report will pull document data for batches in the first report where there is a page count discrepancy. This would dump all document data into a single report which could then be sorted or filtered as needed, instead of trying to do separate reports.



Print Page | Close Window