【问题标题】:Reporting Services Pass In DatasetReporting Services 传入数据集
【发布时间】:2016-03-31 19:08:51
【问题描述】:

我在使用使用临时表的 proc 时遇到了报告服务问题。那么有没有办法从数据表中传递值?我可以在构建数据表之前调用我的 proc,然后我想将表作为数据集传入。我该怎么做?

【问题讨论】:

    标签: sql reporting-services reporting


    【解决方案1】:

    选择临时表中的所有行作为存储过程中的最终语句:

    SELECT * FROM @TempTable
    

    【讨论】:

      【解决方案2】:

      我使用以下代码块解决了我的问题。另请注意,报告服务不喜欢 procs 中的临时表。据我了解,这是一个已知问题,因此上述解决方案不起作用。

       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
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-17
        • 2012-04-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多