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

How to set different data sources to different sections?

Status
Not open for further replies.

alexbelovtt

Programmer
Nov 15, 2005
51
US
I have two recordset set as data source for Crystal 11
I try to display 5 records in section detail 1 and 10 records in section detail 2
Whatever when I run report, section 2 displays after each record in section1
What I want to do – display First 5 records from recordset one, then some static data, then 10 records from recordset 2 and so on.
Any help will be appreciated.

 
Is there a relationship among the 5 records in detail section 1? Is there a relationship among the detail records in detail section 2? Is there a relationship between the the two record sets in sections 1 and 2?

MrBill
 
Crystal supports ONE datasource per report.

Another appraoch might be to use a Command and use a Union Query, such as:

select 'source 1' source, field1, field2 from table1
union all
select 'source 2' source, field1, field2 from table2

You might otehrwise use a subreport in the report footer, for the second data source.

-k
 
Use the second recordset in a subreport which is placed in your report footer (or in a group footer) if you want each recordset to display for each group.

-LB
 
Thank you,
Recordset are not related.
Probably sub reports will be a solution.
When I set data source for sub reports?
Is that possibly to set data source for sub report in section format?

Alex
 
When you insert the subreport, you will be asked to select the datasource as the first step in creating the subreport.

-LB
 
Thank you LB.
I use existing reports as sub reports.
In other words I can use different recordsets from main (parent) report?
Looks as work for me so far, but I want more controls.
For example set different sub reports for same section depend of user options.

 
You can import subreports that have different datasources from the main report. If you want the user to define which subreport they see, you would probably need to insert multiple group sections, each with its own subreport, and then use a parameter to conditionally suppress each section. Or you could set up multiple on-demand subreports, where the user chooses which hyperlink to a subreport to click on.

-LB
 
Thank you LB.
Clear enough.
That is the best forum I know.
Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top