本文介绍了“对象引用未设置为对象的实例。”在ReportDocument.Load(String filename)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i正在使用水晶Reprots XI版本。

i我在收到报告时收到错误。

如果报告名称是错的然后我会得到加载失败的消息。但我得到对象参考未设置为对象的实例

i我给堆栈跟踪:




i am working with crystal Reprots XI version.
i am getting the error in Loading a report .
If the report name is wrong then i will get Load failed Message.But i am getting Object "Reference not set to an instance of an object"
i am giving the stacktrace :

Message: Object reference not set to an instance of an object.
Stack Trace :
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_IsLoaded()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
   at SampleProject.Printtickets.objPrint_GenerateReportDocument()





代码是这个



The code is this

Root = Root + "Reports\Reports\TicketReport.rpt"
       reportGlobal.Load(Root)
       reportGlobal.SetDataSource(ticketdataset)





任何人都知道如何解决这个问题。请解释。



can any one know how to resolve this.please explain.

推荐答案


这篇关于“对象引用未设置为对象的实例。”在ReportDocument.Load(String filename)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 10:43