時當我遇到我的水晶報表缺少的參數值,我跑到哪裏了節目缺少的參數值水晶報表導出
下面的錯誤是我的代碼
_crAdviceRpt.Load("C:\Users\whatever\AD_AdviceTemplate.rpt")
Dim ds As ADDataset = New ADDataset
Dim dt As DataTable = ds.Tables.Add("ADDatatable")
dt.Columns.Add(New DataColumn("strLinesList", Type.GetType("System.String")))
Dim dr As DataRow
dr = dt.NewRow
dr("strLinesList") = strLine
dt.Rows.Add(dr)
_crAdviceRpt.SetDataSource(ds.Tables(1))
CrDiskFileDestinationOptions.DiskFileName = "location.pdf"
CrExportOptions = _crAdviceRpt.ExportOptions
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
End With
_crAdviceRpt.Export()
If Not _crAdviceRpt Is Nothing Then
_crAdviceRpt.Close()
_crAdviceRpt.Dispose()
_crAdviceRpt = Nothing
End If
在我的數據集,但它確實像這樣的: ADDDataset.xsd-> ADDatatable - > strLinesList strLinesList是我列在這裏
在水晶報表設計器,我拖strLinesList交給我。RPT
我不知道什麼是錯的,但我敢肯定的東西是在我的代碼丟失,所以anyhere認識