1

我正在尝试处理本地报告,但在设置参数中出现错误。这是示例代码。

r.ProcessingMode = ProcessingMode.Local

    Dim lr As LocalReport = r.LocalReport

    lr.ReportEmbeddedResource = "Gy.Report1.rdlc"

'笔记报告为空白。

    Dim dss As New DataSet
    Dim daa As New SqlDataAdapter("select * from c_inventory", cn)
    cn.Open()
    daa.Fill(dss, "c_inventory")
    cn.Close()

    Dim dss1 As New ReportDataSource
    dss1.Name = "c_inventory"
    dss1.Value = dss.Tables("c_inventory")

    lr.DataSources.Add(dss1)
    r.RefreshReport()


    'Create a report parameter for the sales order number 
    Dim rpfilled As New ReportParameter()
    rpfilled.Name = "filled"
    rpfilled.Values.Add("0")


    Dim param() As ReportParameter = {rpfilled}
    lr.SetParameters(param)
4

1 回答 1

0

我通常在本地处理模式下设置我的报告参数,所以

Dim p As New ReportParameter("myParameterName", param1.ToString())
rptViewer.LocalReport.SetParameters(New () {p})

所以尝试将你的最后两行更改为

Dim param As New ReportParameter("yourReportParametername", rpfilled)
lr.LocalReport.SetParameters(New () {param})
于 2013-08-14T10:04:41.907 回答