水晶报表工具栏中的按钮问题 [英] Problem with button in crystal report toolbar

查看:101
本文介绍了水晶报表工具栏中的按钮问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生您好,

我正在处理水晶报表.我使用以下代码在Crystal Report工具栏上创建了一个按钮:

Hello sir,

I am working with crystal reports. I created a button on crystal report toolbar using the following code:

reportDocument = (ReportDocument)Session["reportDocument"];
       CrystalReportViewer1.ReportSource = reportDocument;
        System.Web.UI.Control oControl = CrystalReportViewer1.Controls[2];
        //Button oButton = new Button();
        //oButton.ID = "newButton";
        //oButton.Text = "My New Button";
        //oControl.Controls.Add(oButton);
        ImageButton BtnExport = new ImageButton();
        BtnExport.ID = "BtnExport";
        BtnExport.ImageUrl = "~/images/xls.png";
        // BtnExport.ToolTip = "Zoom";
        BtnExport.Click += ImgBtnXls_Click;
        BtnExport.EnableViewState = true;
        oControl.Controls.Add(BtnExport);
        UpdatePanel UpdatePanel1 = new UpdatePanel();

        System.Web.UI.PostBackTrigger trigger = new System.Web.UI.PostBackTrigger();

        trigger.ControlID = BtnExport.UniqueID.ToString();
        UpdatePanel1.Triggers.Add(trigger);


我的问题是,每当我单击按钮以导出报告时,它都会显示如下错误:


My problem is whenever I click the button to export the report, it shows an error like below:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near ''�ࡱ�''.


如果有人知道原因,请帮助我.


If anyone knows the reason, please help me.

推荐答案

为您的UpdatePanel中的按钮 BtnExport 添加一个PostBackTrigger.就这样.
Add a PostBackTrigger to your UpdatePanel for the button BtnExport. That''s all.
<Triggers>
<asp:PostBackTrigger ControlID="BtnExport" />
</Triggers>


有关更多详细信息,请阅读这篇文章. Sys.WebForms.PageRequestManagerParserErrorException-它是什么以及如何避免 [


For more details read this post. Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it[^]


这篇关于水晶报表工具栏中的按钮问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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