簡體   English   中英

Reporting Services傳入數據集

[英]Reporting Services Pass In Dataset

我在使用臨時表的proc中遇到報表服務問題。 那么有沒有辦法傳遞數據表中的值? 我可以在建立數據表之前調用proc,然后再將表作為數據集傳入。 我怎么做?

選擇臨時表中的所有行作為存儲過程中的最后一條語句:

SELECT * FROM @TempTable

我使用以下代碼塊解決了我的問題。 還應注意,報表服務不喜歡proc中的臨時表。 據我了解,這是一個已知問題,因此上述解決方案將不起作用。

 Private Sub Build_Invoice_Report(ByVal Invoice_Number As Long)
    Try
        Dim Report As String = "Weight.Report2.rdlc"
        Dim Bill_Name As String = "US PIPE"
        Dim Bill_Address_1 As String = "2023 ST. Louis Ave"
        Dim Bill_Address_2 As String = "Bessemer, AL, 35020"

        With Me.Report_Viewer.LocalReport
            .ReportEmbeddedResource = Report
        End With

        dt = DataHelperFunctions.GetInvoiceReport(Invoice_Number, Bill_Name, Bill_Address_1, Bill_Address_2)
        Get_Invoice_ReportBindingSource.DataSource = dt

        'Build Variables
        Commodity = CStr(dt.Rows(0)("Commodity"))
        Vendor = CStr(dt.Rows(0)("Vendor_Name"))
        InvoiceStartDate = CStr(dt.Rows(0)("Start_Date"))
        InvoiceEndDate = CStr(dt.Rows(0)("End_Date"))
    Catch ex As Exception
        Dim methodName = CStr(System.Reflection.MethodBase.GetCurrentMethod().Name)
        Dim ClassName = CStr(Me.GetType().Name)
        DataHelperFunctions.ReportException(methodName, ClassName, CStr(ex.ToString), CStr(System.DateTime.Now))
    End Try
End Sub

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM