2012-03-20 160 views
0

我正在使用Windows應用程序,無法創建RDLC本地報告。VB.NET中的窗體RDLC報告參數

報告中只有2個文本框,一個是員工名稱&另一個是地址。

一切都很好,但我無法弄清楚如何通過RDLC報告變量&在報告文本框或報告中顯示其值。

感謝

回答

1

檢查這個帖子:

Using the WinForms ReportViewer Control

編輯:

假設你有一個TextBox控件 「TxtParameter」,您輸入員工的社會安全號碼。

'Create a report parameter for the sales order number 
    Dim rpEmployeeSSN As New ReportParameter() 
    rpEmployeeSSN.Name = "SocialSecurityNumber" 
    rpEmployeeSSN.Values.Add(TxtParameter.Text) 

    'Set the report parameters for the report 
    Dim parameters() As ReportParameter = {rpEmployeeSSN} 
    localReport.SetParameters(parameters) 

    'Refresh the report 
    reportViewer1.RefreshReport() 
+0

嘿@Nathan感謝答覆, 我所擁有的一切設置與我也能看到空白的ReportViewer當我運行應用程序,但便無法將參數傳遞到RDLC。 謝謝 – Pankaj 2012-03-21 05:02:01

+0

檢查我編輯的回覆。 – Nathan 2012-04-02 18:01:38

-2
*****Me.movingselectedTableAdapter.Fill(Me.LRCDBDataSet.movingselected) 
    '+++++++++++++ passing parameter 
    Dim repdate As Date = System.DateTime.Now.ToShortDateString() 
    Dim params(0), myparam As ReportParameter 
    '++++++++++++++++++try2 
    Dim myparams As New List(Of ReportParameter) 
    myparam = New ReportParameter("rptcrdate", repdate) 
    myparams.Add(myparam) 
    'Report_Parameter_1 
    ReportViewer1.LocalReport.SetParameters(myparams) 
    Me.ReportViewer1.RefreshReport()***** 
+3

考慮在答案中添加更多信息。上面的代碼是做什麼的? – ch4nd4n 2012-12-06 10:51:06