如何在webApp中以pdf格式打印水晶报表 [英] how to print crystal report in pdf in webApp

查看:91
本文介绍了如何在webApp中以pdf格式打印水晶报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我们正在开发一个Web应用程序,并且需要在pdf上打印报告.为此,我们使用了如下所示的代码:

Hi All,

we have developing a webapplication and we need to print report on pdf.For this,we have used code as shown below:

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); 


但这在我们在IIS中发布时不起作用.因此请帮助我解决如何通过已部署的wedApp打印pdf格式的报告.


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.

推荐答案

您好... .....................



不需要做所有这一切........


转到crystalreportviewer的属性.............
您将看到一个属性PRINTMODE ........选择pdfmode .........

您的报告将直接在pdfmode中打开...




您可以做的第二件事是将报告导出为pdf格式......

repDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat,Response,true,客户");
使用上面的代码................................
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.......................


这篇关于如何在webApp中以pdf格式打印水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆