我工作的水晶报表,我需要通过值(从的WinForms)到水晶报表 文本框控件的像Period:10-11-2009 To 13-11-20009
这个值我想通过水晶报告TextBox控件水晶报表文本框
提前祝愿......
我工作的水晶报表,我需要通过值(从的WinForms)到水晶报表 文本框控件的像Period:10-11-2009 To 13-11-20009
这个值我想通过水晶报告TextBox控件水晶报表文本框
提前祝愿......
看到这个链接它显示了如何parametar传递给晶report.There是这许多例子只是要求Google
你可以通过VAL用水晶使用参数。然后,您可以在报告中显示这些信息。
您可以从日期和日期,你是通过数据源到水晶报表的细节或标题栏添加..从字段资源管理将这些字段,并把它们放入文本字段
See the code below
//Initialize your report
sample_report yourReport = new sample_report();
CrystalDecisions.CrystalReports.Engine.TextObject variableName=
(CrystalDecisions.CrystalReports.Engine.TextObject)
yourReport.Section2.ReportObjects["nameoftheTextboxInyourReport"];
variableName.Text = "Period:10-11-2009 To 13-11-20009";
只需使用参数,并通过文本框的值:在VB.NET
例子:
Dim rptList As ReportDocument = New ReportDocument()
With rptList
.Load(strPath)
.SetDataSource(dtsData)
rptList.SetParameterValue("SomeName", yourTextBox.Text.trim)
End With
strPath的是路径到.rpt文件和d tsData是数据集。
在SetParameterValue中定义一个名称和值,注意你应该在你的水晶报表中创建一个同名的参数。
我有同样的问题,这里是答案:[传递参数](http://stackoverflow.com/questions/35862733/crystal-report-invalid-index-exception-from-hresult-0x8002000b-disp-e -badin/35954722#35954722) – 2016-03-12 07:11:42