本文介绍了水晶报表中传递参数的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在C#中使用Crystal Reports.

我想知道哪种是获取报告的最佳和最快方法

1.通过如下所示的编码传递参数



Iam using crystal Reports in my c#.

i want to know which is best and fastest way getting reports

1.Passing Parameters thru coding like below

ReportDocument cryRpt = new ReportDocument();
                cryRpt.Load(AppDomain.CurrentDomain.BaseDirectory + "/Reports/PurchaseReturn.rpt");
                ParameterFieldDefinitions crParameterFieldDefinitions;
                ParameterFieldDefinition crParameterFieldDefinition;
                ParameterValues crParameterValues = new ParameterValues();
                ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

                crParameterDiscreteValue.Value = PId;
                crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
                crParameterFieldDefinition = crParameterFieldDefinitions["@PId"];
                crParameterValues = crParameterFieldDefinition.CurrentValues;





2.




or
2.

DataSet PurchaseInvoiceReport = bllPurchaseInvoice.PurchaseInvoiceReport(PINo);

              cryRpt.SetDataSource(PurchaseInvoiceReport.Tables[0]);
              obj.crystalReportViewer1.ReportSource = cryRpt;
              obj.crystalReportViewer1.Refresh();
              clsCR.ApplyLogonToTables(cryRpt);

              obj.ShowDialog();




请帮助

问候
Nirmala Devi




Pls help

Regards
Nirmala Devi

推荐答案


这篇关于水晶报表中传递参数的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 04:19