从水晶报告中导出/下载pdf获取空白页面。 [英] Exporting/downloading pdf from crystal reports getting with blank pages.

查看:50
本文介绍了从水晶报告中导出/下载pdf获取空白页面。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在C#有一个asp.net网站,目前正在网上运行。



我也有水晶报告,我正在尝试将报告导出为PDF格式。



code

Hi guys,

I have an asp.net website in C#, currently running online.

I have crystal reports too and i'm trying to export reports to PDF format.

code

public void DownloadPDF(ReportDocument rd)
   {
       ReportDocument cryRpt = new ReportDocument();
       cryRpt = rd;
       CrystalReportViewer1.ReportSource = cryRpt;
       CrystalReportViewer1.RefreshReport();
       cryRpt.ExportToHttpResponse
       (CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "OptReport_" + DateTime.Now.ToShortDateString());
   }





当我以pdf格式导出/下载时,本地工作正常。



i表示:用户将选择Department,fromdate n todate。根据这些信息,

用户将获得no.of门票。

(本地我将以pdf [无空白页]逐一获取此门票)。



但是当我发布它然后把它放在服务器然后尝试导出/下载,

它的获取但是有空白页面。

(当我试图从服务器下载时,它会在每张票后添加空白页)。



有人可以帮助我。





谢谢



When i'm exporting/downloading in pdf format, locally its working fine.

i mean: the user will select Department, fromdate n todate. Based on this information,
the user will get no.of tickets.
(locally i'm getting this tickets one by one in pdf[no blank pages]).

But when i published it n put it on server and then trying to export/download,
its getting but with blank pages.
(when i'm trying to download from the server, its adding blank pages after each ticket).

can anyone please help me.


Thanks

推荐答案

试试这个代码

Try this code
CrystalReportViewer1.ReportSource = rptDoc;

                    CrystalReportViewer1.Visible = true;
                    CrystalReportViewer1.HasPageNavigationButtons = true;
                    CrystalReportViewer1.HasCrystalLogo = false;
                    CrystalReportViewer1.HasDrillUpButton = false;
                    CrystalReportViewer1.HasSearchButton = false;

                    CrystalReportViewer1.HasToggleGroupTreeButton = false;
                    CrystalReportViewer1.HasZoomFactorList = false;
                    CrystalReportViewer1.AllowedExportFormats = (int)CrystalDecisions.Shared.ViewerExportFormats.PdfFormat;
                   // CrystalReportViewer1.PrintMode = PrintMode.Pdf;
                    CrystalReportViewer1.HasPrintButton = false;


这篇关于从水晶报告中导出/下载pdf获取空白页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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