CrystalReport报表显示的内容不正确
fxp49 2006-12-14 11:08:42 报表时用:CrystalReport1.rpt。
数据源时用Object 集合:建一个类,加入属性、函数。函数调用数据库的存储过程返回记录集。
在页上添加CrystalReportViewer控件myCrystalReportViewer1, ConfigureCrystalReports()过程代码如下:
Private Sub ConfigureCrystalReports()
PopulateStockValuesArrayList()
Dim reportPath As String = Server.MapPath("CrystalReport1.rpt ")
stockObjectsReport = New ReportDocument()
stockObjectsReport.Load(reportPath)
stockObjectsReport.SetDataSource(InvoiceTotalValues)
myCrystalReportViewer1.ReportSource = stockObjectsReport
End Sub
问题:如果在存储过程中的SELECT 后面的字段列表中插入列,例如:
SELECT 字段1,字段2,1 AS COL1 FROM TABLE1
结果是:在查询分析分析器中显示的结果正确,在页面中用GridView控件显示也正确,在报表中显示的行数、列数都正确,但是报表中显示的内容不正确,字符全为空,数值全为0。