Quantcast
Channel: Visual Studio Report Controls Forum
Viewing all articles
Browse latest Browse all 519

How can a multi-page PDF file be created?

$
0
0

I am currently able to create a PDF file with the following code:

ReportDataSource dataSource = new ReportDataSource("<dataSetName>", <collection of business objects>);
ReportViewer viewer = new ReportViewer();
viewer.ProcessingMode = ProcessingMode.Local;
viewer.LocalReport.ReportPath = reportPath;
viewer.LocalReport.DataSources.Add(dataSource);
byte[] bytes = viewer.LocalReport.Render("PDF");
Response.ContentType = "application/pdf";
Response.Clear();
Response.BufferOutput = true;
Response.AddHeader("content-disposition", "attachment; filename=<fileName>.pdf");
Response.BinaryWrite(bytes);
Response.Flush();

My <collection of business objects> currently contains one item that is used to set the data on the .RDLC file. 

Is it possible to create a PDF file with multiple pages by using the same .RDLC file? 

For example:

If my <collection of business objects> contained 3 items.  I would like to create a PDF file containing 3 pages.  Each page would use the same RDLC file representing an item in the <collection of business objects>. 


Viewing all articles
Browse latest Browse all 519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>