Print Page | Close Window

Print 2 or more reports in one click

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1538
Printed Date: 03 May 2025 at 12:16am


Topic: Print 2 or more reports in one click
Posted By: botete
Subject: Print 2 or more reports in one click
Date Posted: 21 Oct 2007 at 8:50pm
Hi and Good Day!
 
I have an .aspx page that I would like to generate 2 reports, e.g., Offer.rpt (details) and Letter.rpt (covering letter), which I want to be printed simultaneously in just one click of a button. I tried inserting the second part just next from the first, but only the first page was called and only the Offer.rpt was printed.
 
// for Offer.rpt
 
                Session["codate"] = forfiltering;
                Session["brokercode1"] = DropDownList1.Text;
                Response.Redirect("Offer.aspx"); 
 
// for Letter.rpt
 
                Session["brokercode2"] = DropDownList1.Text;
                Response.Redirect("Letter.aspx");
 
Could anyone give me a sample procedure or the correct way of coding these? Thank you!
 
 
Bo Smile



Replies:
Posted By: botete
Date Posted: 23 Oct 2007 at 7:09pm

help please!



Posted By: BrianBischof
Date Posted: 23 Oct 2007 at 11:00pm
You can call the PrintToPrinter() method of the ReportDocument class for each report. I never tried printing out two reports in the same page, but it will probably work.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: botete
Date Posted: 25 Oct 2007 at 12:58am
Thanks Sir. Yes I already used the PrintToPrinter() method for each page, but only the first is printed.
 
If I may ask, this just came into mind, since if called the first page, doesn't the control goes back to the calling page to call the next? Is there a need to call another command for the control to go back to the calling page?
 
Is this is so with ASP.net?
 
Thanks,
Bo Smile


Posted By: BrianBischof
Date Posted: 25 Oct 2007 at 8:01am
Yes, this is so for ASP.NET. However, I don't know why it wouldn't be working for your reports. Must be how the viewer interacts with the web page.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window