我在VS2008中有一个Web项目。问题是,从Web报告查看器;报告没有打印或输出为pdf。报告显示正常,但按下打印按钮或导出按钮时,没有任何反应。没有错误或崩溃。只是没有发生。默认打印机设置好,我可以从该机器打印..我在这里错过了一些东西?VS2008 CR报告查看器。打印和导出为PDF不起作用
早些时候,当我安装一个新的虚拟目录的报告应用程序在我的新创建的Web应用程序根没有得到显示,我已经复制aspnet_Client文件夹,然后将报告可见。但是,打印和导出功能不起作用。
我在VS2008中有一个Web项目。问题是,从Web报告查看器;报告没有打印或输出为pdf。报告显示正常,但按下打印按钮或导出按钮时,没有任何反应。没有错误或崩溃。只是没有发生。默认打印机设置好,我可以从该机器打印..我在这里错过了一些东西?VS2008 CR报告查看器。打印和导出为PDF不起作用
早些时候,当我安装一个新的虚拟目录的报告应用程序在我的新创建的Web应用程序根没有得到显示,我已经复制aspnet_Client文件夹,然后将报告可见。但是,打印和导出功能不起作用。
你在报表文件本身保持启用状态?我不得不将我的报告添加到会话并在页面加载时重置报告源。
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("blargh.rpt"));
//...
rptViewer.ReportSource = report;
Session [Constants.Session.Report] = report;
protected void Page_Load(object sender, EventArgs e)
{//detects wether or not the RepoerViewer should be displayed again, to avoid it displaying an empty modal box.
if (hdfDisplayCrystalReport.Value == "Yes")
{
rptViewer.ReportSource = (ReportDocument)Session[Constants.Session.Report];
}
if (rptViewer.ReportSource == null)
{
hdfDisplayCrystalReport.Value = string.Empty;
}
}
您是否在UpdatePanel中使用报告?如果是这样,检查已放置在面板内部触发:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
DisplayGroupTree="False" oninit="CrystalReportViewer1_Init" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="CrystalReportViewer1"/>
</Triggers>
</asp:UpdatePanel>
也检查你有ViewState
的页面
这里有什么值得装配此类Constants.Session.Report。 – 2014-04-07 06:39:00