This is a migrated thread and some comments may be shown as answers.

How to duplicate data with SubReport

2 Answers 106 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David A.
Top achievements
Rank 1
David A. asked on 20 Jun 2011, 03:11 AM
Hi,

I have a tax form that is 8.5 x 11 that displays the data for a vendor twice on the same page (top and bottom).  I created a report that is 8.5 x 5.5 that is used as a template for the data.  I then created a report with two 8.5 x 5.5 subreports that are the report from above.  If the report has two records,  I want page one to display Vendor A on the top and bottom, and page two to display Vendor B on the top and bottom.  What I am getting is Vendor A at the top and Vendor B at the bottom on page one, and the same on page two. How can this be done?  Thank you.

My code:
// in ctor of main report
 
sr1099Top.ReportSource = new Forms.v5.SR_Vendor1099() { Name = "sr1099Top" };
sr1099Bottom.ReportSource = new Forms.v5.SR_Vendor1099() { Name = "sr1099Bottom" };
 
sr1099Top.ReportSource.DataSource = sr1099Bottom.ReportSource.DataSource = ds.Tables["Vendors"].DefaultView;

2 Answers, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 20 Jun 2011, 10:01 AM
David, as you mention in your post, a report is a template that is filled with data once processed. So as a template, in order to have a subreport display both on top and bottom of a page, you should have this same subreport placed both on top and bottom. The paging of the report is processed last (after the data has been filled, so you cannot use this to make a check and change the reports). More info on that in the http://www.telerik.com/help/reporting/designing-reports-understanding-report-sections.html topic.
If I were you, I would create a single report for each vendor and then combine them in a ReportBook (http://www.telerik.com/help/reporting/designing-reports-general-explanation.html).

Cheers!
0
David A.
Top achievements
Rank 1
answered on 20 Jun 2011, 03:10 PM
Thank you for the suggestion Massimiliano!  I just tried that and unfortunately I get the same results.  I created a ReportBook and added the same report twice to it.  It still prints Vendor A & B on page 1 and Vendor A & B on page 2.  I am trying to get Vendor A on page 1 (top and bottom) and Vendor B on page 2 (top and bottom).


Tags
General Discussions
Asked by
David A.
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
David A.
Top achievements
Rank 1
Share this question
or