Last post Jul 08, 2014 10:52 PM by Starain chen - MSFT
Jul 07, 2014 04:04 AM|darji_nitish|LINK
I'm currently using Visual Studio 2010(4.0) ,Crystal Reports Developer 13.0.2 and my OS windows 7 Ultimate 64 bit.
now i add install printer on DropDownList and add Button for Print Crystal report using printtoprinter(noofcopy, true, startno, endno).
it work on developer machine fine but not work print on IIS 6.0. i can view crystal report perfectly on IIS 6.0.
i want to print crystal report on IIS when button click event. i try every thing for print crystal report on IIS but still not print.
if any suggestion please give me reply..
thank in advance..
Jul 07, 2014 04:15 AM|SSA|LINK
May be you already checked but
On the server (where your IIS is), is their any printer installed and marked as default?
Jul 07, 2014 06:43 AM|darji_nitish|LINK
my developer machine and IIS host machine both are same and local it work perfect but it's not work on IIS.
I add printer list on DropDownList it code below.
foreach (String printer in PrinterSettings.InstalledPrinters)
And use Button Click Event for print Crystal Report it code below
protected void btn_print_Click(object sender, EventArgs e)
string PrinterName = ddl_printers.SelectedItem.Text;
//string SystemName = "\\\\SMARTAPPS-PC1\\";
//Get the Copy times
int nCopy = Check_Integer(txt_no_of_copy.Text);
//Get the number of Start Page
int sPage = Check_Integer(txt_from_page.Text);
//Get the number of End Page
int ePage = Check_Integer(txt_to_page.Text);
//CrystalDecisions.Shared.PageMargins edges = new CrystalDecisions.Shared.PageMargins(1, 1, 1, 1);
//CrystalDecisions.Shared.PaperSize ps = new CrystalDecisions.Shared.PaperOrientation.
CustomerReport.PrintOptions.PrinterName = PrinterName; //"\\\\192.168.1.102\\" +
//CustomerReport.PrintOptions.PaperOrientation = PaperOrientation.Portrait;
//CustomerReport.PrintOptions.PaperSize = PaperSize.PaperA4;
CustomerReport.PrintToPrinter(1, true, 0, 0);
//CustomerReport.PrintOptions.PrinterName = PrinterName;
//CustomerReport.PrintToPrinter(1, false, 0, 0);
i try everything (change registry, change printer mode = Active x, change ReportDocument.PrintOptions.PrinterName=PrinterName;
but i can't get any solution for printtoprinter on IIS 6.0
if any one face this problem and solve or know solution please help me. i spend 10 day to find print crystal report on IIS but no result.
thanks in advance.
Jul 08, 2014 02:18 AM|Starain chen - MSFT|LINK
In my opinion, it can’t print crystal report if the application is host in the IIS. The reason of it could works fine when you run the application through VS is that the application that run from the VS directly has the enough permission and it runt the
application as client. However, when the application in the local IIS, it couldn’t call client application.
Jul 08, 2014 08:58 AM|darji_nitish|LINK
thanks for your reply
I think crystal report should work on IIS. my crystal report open on IIS perfectly, Export to PDF and other All Export function work perfectly but my Crystal Report not print on printer.
I know on my developing machine user have All Permissions for Printing and not to IIS user.
If any one face this problem and solve it please reply me suggestion.
thanks in advance.
Jul 08, 2014 10:52 PM|Starain chen - MSFT|LINK
my crystal report open on IIS perfectly, Export to PDF and other All Export function work perfectly
In my opinion, that different to the print. To print the report, it needs to call client software.
For the permission issue, you could implement impersonation, more information, please refer to:
# How to implement impersonation in an ASP.NET application