本文介绍了报告源获取null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1 DataTable aDataTable = aInvoiceCreationBLL.GetInvoiceInfoForPrintBLL(InvoiceCode).Copy();  
2 aDataTable.TableName="aDataTable";
3 DataSet dsDTSet = new DataSet();
4 dsDTSet.Tables.Add(aDataTable);
5 CrystalReport2 areport = new CrystalReport2();
6 areport.SetDataSource(dsDTSet);
7 crystalReportViewer1.ReportSource = areport;



当我调试代码时,我在线获取数据6来自数据表。但是当光标到达第7行时,会出现错误对象引用未设置为对象的实例。

请帮助我。请查看我的代码是对还是错。我将非常遗憾。


When I debug the codes I get data in Line 6 from datatable. But when cursor come to line no 7 it arises an error "Object reference not set to an instance of an object."
Please help me. Please see if my code is right or wrong. I will very regretful.

推荐答案


这篇关于报告源获取null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 21:15