on 12-12-2020 10:56 PM
Dim RptDoc = New ReportDocument
Dim exOpt As ExportOptions
Dim dfdopt = New DiskFileDestinationOptions
RptDoc.Load(Server.MapPath("~/InvoiceWithPayments.rpt"))
dfdopt.DiskFileName = Server.MapPath("~/Invoice" & Invoice & ".pdf")
exOpt = RptDoc.ExportOptions
exOpt.ExportDestinationType = ExportDestinationType.DiskFile
exOpt.ExportFormatType = ExportFormatType.PortableDocFormat
exOpt.DestinationOptions = dfdopt
RptDoc.SetParameterValue("InvoiceNumber", CObj(14161))
RptDoc.Export()
I am facing following error in running the above code
[NullReferenceException: Object reference not set to an instance of an object.]
CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +645
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext) +208
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export() +68
CrystalDecisions.CrystalReports.Engine.ReportDocument.Export() +58
ASP.cr2pdf_aspx.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in C:\Customers\CR2PDF.aspx:76
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +9737744
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1303
Remember. Report file have all credential saved to connect. This code works well on Win8 and Win2012 Server but don't work another instance of Win2012 Server.
Thanks
Use Fiddler and compare the info.
It should also show you what is missing or does not have permissions to.
Has Records = True just means it's a report with saved data, it does not and never has saved the password in any version of CR Reports. That would be a huge security hole...
If no issue with 64 bit that means you have the 64 bit Client installed and configured, not working in 32 bit means you don't have the 32 bit Client install and/or it's not configure and/or not working.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
11 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.