4
votes

Maybe someone can Help me find the right technique.

I have a number of Crystal Reports that I am updating (Crystal Reports XI). These reports each have an SQL Function associated with each that either retrieves records from the database (if any meet criteria) or returns an Empty Dataset (which happens daily). These are executed in a batch process and directs the output to a PDF file which is emailed to users.

I am relatively new to Crystal Reports.

I am attempting to use a common SubReport to format/gather data for the Headers/Footers used in these documents. So far - most of this is working as I would expect. This allows me to use a single SubReport to generate the same Header/Footer in multiple reports (at least that's my goal).

However - I added a Report Footer section to the Main Report - my plan with this was to generate a Report Footer that would contain the following information:

  1. A static Text Message that reads " --- END OF DOCUMENT ---"
  2. The Report Title of the "Main Report"
  3. The Date and Time that the Document was generated and Total Number of pages.

Sounds pretty simple.

So SubReport is named: "END-OF-DOCUMENT-SUBREPORT"

I used the "Special Fields" Data Date, Data Time, & Page N of M

Since the "Special Field" Report Title is returning me the "END-OF-DOCUMENT-SUBREPORT" value I used a Parameter field to pass the Report Title value from the Main Report to the SubReport.

This all works fine - HOWEVER - with the addition of the Linked Parameter Field from the Main to the SubReport - when I execute the report to generate the document - the SubReport ends up showing a blank Report Footer - that I can click on to reveal the "END-OF-DOCUMENT-SUBREPORT" in another Tab. Without the Parameter field - it didn't do this and the information from the SubReport appeared on the last page of the document.

Is this a standard behavior of Crystal?
I'm not sure how to Suppress the "Drill Down" feature and still display the Report Section.

1
I may not be helpful, but if you dont want any kind of link between the subreports and main report, why do you even want to use a Subreport? Why not just use a Text Field/Formula that does the same and have the condition to show/hide it?aMazing
This may be a helpful suggestion - possibly using the SubReport isn't the best approach. I wanted to have a predefined Format for the Header/Footer that I can use in any Report. There is data within the Header/Footer that comes from the database that can change on occasion (When Phone #, Address or Director of services changes). It seemed like passing the parameter from the Main report to the SubReport caused the SubReport to become a "drilldown" in the output. Good suggestion and I'll see what I can find.K. Bacca

1 Answers

1
votes

You can pass variable between you Main Report and sub Report. You can also create variable and assigned them to a sub report. As aMazing mention, creating Header and Report Footer sub report is not common. It is even messy. If you want something generic, I will create a report template that you will use in the future.

Have a good day!