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

Need Report Totals on First Page 2

Status
Not open for further replies.

WilliamLJohnson

Programmer
Sep 4, 2006
4
US
I am using Crystal Reports 8.5 in a Prolog environment.

For this report, the client requires the report totals to show at the top of the first page, while still retaining the ability to filter the report on specific, multiple database fields.

Creating a subreport linked to the filterable fields in the report header to calculate and display the totals has the problem that the values of the fields have not been evaluated at the time the header is generated. Making the report totals the main report and the details a subreport in the report footer would encounter a similar problem.

I am familiar with the proper methods for passing parameters into a subreport, but do not know how to access the report filter at runtime as a variable.

Does anyone know either how to designate the filter as a field object, or see a better method of accomplishing the stated goal of this report?
 
Depending upon the complexity of your report, you may be able to simply place a crosstab in your report header that displays totals.

I don't follow your issue with subreports. If you needed to use a subreport in the report header to accomplish the task, it would be simple to use the same parameters in the subreport as in the main report so that the totals matched. You would then link the subreport to the main report on the parameters. In the subreport linking screen, in the bottom left corner, you would use the dropdown to choose {?parm}, NOT {?pm-?parm}. The subreport would have to contain the same selection formula as the main report.

-LB
 
Thank you for responding, Ibass.

The client's requirements for the visual appearance of the totals is complex enough that a crosstab is not feasible.

My problem with using the subreport links is that only the {?pm-?parm} field is showing in the drop-down list on the bottom left corner of the subreport links screen. Both report and subreport are using the same databases - Active Data (Field Definitions only). One of the fields the client wants to filter on is the only grouping on both reports, the rest are not groupings. Three of the filter fields are not displayed on either report, two are. The linking screen displays the same behavior in all cases.
 
The parameters have to have the same name in both subreport and the main report, and they have to be of the same datatype, and they have to be used somewhere in the report, e.g., in the record selection formula. If these criteria are met, then the parms should appear in the dropdown.

Can you clarify whether by "fields to filter on" you are referring to parameterized fields? This is very abstract, and I think it would help if you identified the fields you are filtering on by showing the record selection formula (both in the subreport and main report, if different).

-LB
 
As the report is currently constructed, the fields the client wishes to be able to filter on have not been parameterized. Prolog's Report Manager screen allows the user to specify the record selection criteria at runtime by presenting the entire list of database and formula fields available to the report file to use in filtering. Thus, the record selection formula is not available when designing the report in Crystal.

Is it possible to create a formula in both report and subreport that are defined at runtime as the report selection formula?
 
I'm not familiar with integrating with other applications. It seems to me that you should, however, be able to save the same report under another name and insert it as a subreport in the report header. Then you could suppress unwanted sections in the subreport.

-LB
 
lbass, thank you again for all your help.

I've tested the report modified as you suggested. The result is that the Prolog interface gives the user the ability to set up the filter criteria for the report and subreport seperately. (It gives a dropdown list on the filter setup tab for every data group in the report, and treats the data groups for the subreport as seperate from those on the main report.) While this does make the report give the desired results, the client would prefer to only input the filter criteria once.

I'll give this to them for their use and keep looking for a method to set the subreport's record selection SQL statement to be the same as the main report's.
 
Within Crystal, the linking would have eliminated the duplicate prompts. I'm not sure how this is accomplished when the parameters are passed from another application. Maybe someone else can help. You might want to start a new post, although I'm not sure whether this is really a CR question or a Prolog question.

-LB
 
William:

A technique I use to put the Grand Totals at the top of the report is by using a "false page header," that is, making Group 1 a formula something like: if isnull({table.field}) then 'Total' else 'Total'. This way, summary fields can be put in the Group 1 header that reflect the entire recordset.

jayhack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top