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!

Hi I am making 5 crystal reports. I

Status
Not open for further replies.

tanyasharma

Programmer
Apr 29, 2002
21
US
Hi I am making 5 crystal reports. I have being using five different vies for each report although reports are same but just filter condition is different.Is there anyway to use different view with same crystal report.
Thanks
 
Sure, just make sure when you write the reports they just all have the same data source - the first view you used. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
I'm somewhat new to CR myself though, I too have some reports as you described. What I did was load the first report and set the filters as you like, then select "save as" in the file drop down menu, 'don't save the data with the report', name it to your liking. Next, change the filters to what need to be met for the second report and then choose "save as" and name it to your liking, then the continue this for the other reports. Hope this helps.
Phillipg
 
Phillip

If you have 5 reports based on the same data tables and linkages...you can consolidate them into one report with a parameter option for the user to select the look that they want.

It is actually quite fast to do this.

1. take the most complicated report for the basic look (say it is Report 1).
2. add a parameter called "Report Selection"

{?ReportSelection}
Type: string
Description: Choose 1 - report 1
2 - report 2
3 - report 3
4 - report 4
5 - report 5
default: 1

(You could use a picklist as well

3. now open up another report (say Report 2)...are there common sections to both reports? That is great if there is. But let us say that though they are grouped the same the Group 1 headers are different....

Well then break the Group 1 header into 2 sections...the first section will have the fields for Report 1 and the second section you just copy the fields in the Report 2 Group 1 header and then paste them into the section B of the new report Group 1 header.

4. In the section expert for the Group 1 header section "a"
you place the formula:

WhilePrintingRecords;
{?ReportSelection} <> 1;

Similarly for Group 1 section &quot;b&quot; the formula would be

WhilePrintingRecords;
{?ReportSelection} <> 2;

Do you see the process?? now you are turning on and off sections of the report depending on the parameter value selected by the user.

You can even affect the grouping of a report by making the groups based on formulas

@group1

if {?ReportSelection} = 1 then
{Table.value1}
else if {?ReportSelection} = 2 then
{Table.value2}

... other choices ...

else
{Table.value1}; // a default value

Only thing here to be careful of is that All grouping choices must be the same variable type...so if mixed numeric/string then convert all numerics to strings using the totext function.

That is the basic approach, just create selection specific sections controled though the user selection parameter.

These reports can get quite complicated though and there are many tricks you can employ....my record is consolidating 15 reports into one report with user options for one of my clients.

If you like this approach and are having trouble...just ask and we'll walk you through it :)
Jim Broadbent
 
Tanya...I meant that message for you as well :) Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top