Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

we have developing a webapplication and we need to print report on pdf.For this,we have used code as shown below:
C#
ReportDocument doc = new ReportDocument();
            doc.Load(Server.MapPath("TicketReport.rpt"));
            doc.SetParameterValue("@theaterId", theater_id);
            doc.SetParameterValue("@screenId", Screen_ID);
            doc.SetParameterValue("@MovieId", Movie_ID);
            doc.SetParameterValue("@ClassId", Class_ID);
            doc.SetParameterValue("@movie_ShowDate", dt);
            doc.SetParameterValue("@BookId", book_Id);
            doc.SetParameterValue("@Col_No", Convert.ToInt32(colmnArray[j].ToString()));
            doc.SetParameterValue("@row_No", ronNoNew);
          
            doc.SetDatabaseLogon("sa", "sa", "DS1", "CineVistaDB");
         
            doc.PrintOptions.PrinterName = "PdfFactory";
            doc.PrintToPrinter(1, false, 1, 1); 

But this is not working when we published in IIS.So please help me out in this that how to print pdf format report by deployed wedApp.
Posted
Updated 25-Aug-11 1:01am
v2
Comments
Prerak Patel 25-Aug-11 7:06am    
Use code block for code segments.
Pravin Patil, Mumbai 25-Aug-11 7:14am    
Not working means what....? What error you are getting.....?
ks ravi 25-Aug-11 8:20am    
Error means its not at all printing anything.i wondering its with crystal report.please give me any other solution.

1 solution

Hi ........................



no need to do all this.................


go to properties of crystalreportviewer...................
you will see a property PRINTMODE........select pdfmode............

your report will directly open in pdfmode...............




second thing which you can do is to export the report in pdf format......

repDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat,Response,true,"Customers");
using the above code.......................
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900