2009-11-13 112 views
0

我工作的水晶報表,我需要通過值(從的WinForms)到水晶報表 文本框控件的像Period:10-11-2009 To 13-11-20009這個值我想通過水晶報告TextBox控件水晶報表文本框

提前祝願......

+0

我有同樣的問題,這裏是答案:[傳遞參數](http://stackoverflow.com/questions/35862733/crystal-report-invalid-index-exception-from-hresult-0x8002000b-disp-e -badin/35954722#35954722) – 2016-03-12 07:11:42

回答

1

你可以通過VAL用水晶使用參數。然後,您可以在報告中顯示這些信息。

0

您可以從日期和日期,你是通過數據源到水晶報表的細節或標題欄添加..從字段資源管理將這些字段,並把它們放入文本字​​段

1
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"; 
0

只需使用參數,並通過文本框的值:在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中定義一個名稱和值,注意你應該在你的水晶報表中創建一個同名的參數。