为什么在打印/导出时Crystal再次报告必需的参数 [英] Why crystal report required parameter again when print/export

查看:75
本文介绍了为什么在打印/导出时Crystal再次报告必需的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,我正在开发一个asp .net应用程序(Webform),其中我使用Crystal Report来显示报告(带有存储过程).

Dear all I am working on an asp .net application (Webform) in which I am using crystal report for showing reports (with store procedure ).

在我的应用程序中,包括报告在内,一切正常.真正的问题出在我开始单击Crystal Report工具栏上时.如果我单击水晶报表工具栏上的任何按钮(如(导出,下一页...等)),它将再次询问参数.有什么方法可以使Crystal Report查看器不询问我已经给定的参数吗?

In my application everything works fine including the reports. The real problem comes when I start clicking on the crystal report toolbar. If I click on any buttons on the crystal report tool bar like (Export, next page ...etc.) it is asking parameters again. Is there any way so that that the crystal report viewer does not ask the parameter that I have already given ?

 ReportDocument r = new ReportDocument();
                r.Load(Server.MapPath("~/Consumers/Reports/JobOrder.rpt"));
                SqlParameter[] para= new SqlParameter[1];
                para[0]= new SqlParameter("@OrderId",JobOrder);
                dt=da.ExecuteQuery("sp_rpt_JobOrder",para);
                if(dt.Rows.Count>0)
                {
                    r.SetParameterValue("@OrderId", JobOrder);
                    r.SetDataSource(dt);
                    CrystalReportViewer1.ReportSource = r;
                }

有人可以帮助我吗?高度赞赏.

can some one help me? Highly appreciated.

推荐答案

其原因是由于回发.所以我删除了

its causing due to post back. so i removed

if (!Page.IsPostBack)

现在对我来说工作正常.

now its working fine for me.

谢谢.

这篇关于为什么在打印/导出时Crystal再次报告必需的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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