<legend id='uPvV8'><style id='uPvV8'><dir id='uPvV8'><q id='uPvV8'></q></dir></style></legend>
  1. <tfoot id='uPvV8'></tfoot>
  2. <i id='uPvV8'><tr id='uPvV8'><dt id='uPvV8'><q id='uPvV8'><span id='uPvV8'><b id='uPvV8'><form id='uPvV8'><ins id='uPvV8'></ins><ul id='uPvV8'></ul><sub id='uPvV8'></sub></form><legend id='uPvV8'></legend><bdo id='uPvV8'><pre id='uPvV8'><center id='uPvV8'></center></pre></bdo></b><th id='uPvV8'></th></span></q></dt></tr></i><div id='uPvV8'><tfoot id='uPvV8'></tfoot><dl id='uPvV8'><fieldset id='uPvV8'></fieldset></dl></div>
      <bdo id='uPvV8'></bdo><ul id='uPvV8'></ul>

    1. <small id='uPvV8'></small><noframes id='uPvV8'>

      从网络表单将参数传递给 Crystal 报表

      时间:2023-07-09
    2. <tfoot id='E5aJM'></tfoot>
    3. <legend id='E5aJM'><style id='E5aJM'><dir id='E5aJM'><q id='E5aJM'></q></dir></style></legend>

      <small id='E5aJM'></small><noframes id='E5aJM'>

          <bdo id='E5aJM'></bdo><ul id='E5aJM'></ul>
            <tbody id='E5aJM'></tbody>

              • <i id='E5aJM'><tr id='E5aJM'><dt id='E5aJM'><q id='E5aJM'><span id='E5aJM'><b id='E5aJM'><form id='E5aJM'><ins id='E5aJM'></ins><ul id='E5aJM'></ul><sub id='E5aJM'></sub></form><legend id='E5aJM'></legend><bdo id='E5aJM'><pre id='E5aJM'><center id='E5aJM'></center></pre></bdo></b><th id='E5aJM'></th></span></q></dt></tr></i><div id='E5aJM'><tfoot id='E5aJM'></tfoot><dl id='E5aJM'><fieldset id='E5aJM'></fieldset></dl></div>
                本文介绍了从网络表单将参数传递给 Crystal 报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一份报告,我想在网络表单上显示它.没有参数的报告工作得很好.带有参数的报告让我很头疼.这是我在 BindReport 方法中编写的代码,在表单的页面加载事件中调用.

                i have a report and i want to display it on a webform. Reports without parameters are working nice and fine. Reports with parameters are creating headache for me. this is the code i have written in BindReport method, which is called on page load event of the form.

                    ReportDocument rpt = new ReportDocument();
                    rpt.Load(Server.MapPath("rptPositionwiseMontwiseActualSale.rpt"));
                    rpt.FileName = Server.MapPath("rptPositionwiseMontwiseActualSale.rpt");
                    rpt.SetParameterValue("CompanyName", "Cirin Pharmaceutical Pvt. Limited".ToString());
                    rpt.SetParameterValue("ReportTitle", "PositionWise MonthWise Sales".ToString());
                    rpt.SetParameterValue("parameters", "Year:2011".ToString());
                    //CrystalReportViewer1.ParameterFieldInfo = paramFields;
                    DataSet ds = getReportData();
                    rpt.SetDataSource(ds.Tables[0]);
                    CrystalReportViewer1.ReportSource = rpt;
                    CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;
                
                    //CrystalReportViewer1.RefreshReport();
                

                我尝试了各种方法,例如将 ParameterFieldInfo 分配给 reportviewer 控件,但是它在页面加载时提示我询问报表的参数值.我正在使用 .NET 4.0
                编辑 我正在使用推送模型来处理水晶报表.它是否改变了我们传递参数以从 asp.net 报告的方式
                谢谢

                i have tried variety of things like assigning ParameterFieldInfo to reportviewer control but, it shows me prompt on page load asking for parameter values of the report. i m using .NET 4.0
                EDIT i m using push model for crystal reports. does it change the way we can pass parameters to report from asp.net
                thanks

                推荐答案

                在运行时为 ASP.NET 设置参数值时,我认为您需要做的工作不仅仅是调用 SetParameterValue

                When setting Parameter values at runtime for ASP.NET I think you need to do a bit more work than just called SetParameterValue

                string rptTitle = "This is Report Title";
                
                rpt.SetParameterValue("ReportTitle", rptTitle);
                
                ParameterDiscreteValue val = new ParameterDiscreteValue();
                val.Value = rptTitle;
                
                ParameterValues paramVals = new ParameterValues();
                
                paramVals.Add(val);
                
                rpt.ParameterFields["ReportTitle"].CurrentValues = paramVals;
                
                rpt.DataDefinition.ParameterFields[0].ApplyCurrentValues(paramVals);
                

                这可能有点矫枉过正,但它确实有效,无论如何对我来说都很好.您必须确保参数名称完全匹配.

                This is probably a bit of overkill but it does actually work, well for me anyway. You must ensure that the parameter names match exactly.

                这篇关于从网络表单将参数传递给 Crystal 报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何管理 Crystal Report Dispose? 下一篇:不同版本的 Crystal Reports 运行时

                相关文章

                <legend id='gtRHO'><style id='gtRHO'><dir id='gtRHO'><q id='gtRHO'></q></dir></style></legend>

              • <tfoot id='gtRHO'></tfoot>

                <small id='gtRHO'></small><noframes id='gtRHO'>

                  <i id='gtRHO'><tr id='gtRHO'><dt id='gtRHO'><q id='gtRHO'><span id='gtRHO'><b id='gtRHO'><form id='gtRHO'><ins id='gtRHO'></ins><ul id='gtRHO'></ul><sub id='gtRHO'></sub></form><legend id='gtRHO'></legend><bdo id='gtRHO'><pre id='gtRHO'><center id='gtRHO'></center></pre></bdo></b><th id='gtRHO'></th></span></q></dt></tr></i><div id='gtRHO'><tfoot id='gtRHO'></tfoot><dl id='gtRHO'><fieldset id='gtRHO'></fieldset></dl></div>

                    • <bdo id='gtRHO'></bdo><ul id='gtRHO'></ul>