PDF EXPORT
Hi, Im hoping someone can help me. I want to do what i thought was simple... I have an asp.net web page (vb) which I want to use to run a report and produce a PDF on one button click, There is a requirement that there will be no user intervention. only that they click the button and the pdf is created and saved to a folder on the server.
I have used the following code which seems to run without error until it comes to export the PDF it then errors with a "Object reference not set to an instance of an object." error
the code without the data selection is as below...
Dim fastreport1 As New WebReport
fastreport1.Report.Load(Request.PhysicalApplicationPath + "/reports/harvest_doc1.frx")
fastreport1.RegisterData(dt, dt.TableName)
fastreport1.Prepare()
Dim export1 As New FastReport.Export.Pdf.PDFExport
fastreport1.Report.Export(export1, "d:\result.pdf")
I have used the following code which seems to run without error until it comes to export the PDF it then errors with a "Object reference not set to an instance of an object." error
the code without the data selection is as below...
Dim fastreport1 As New WebReport
fastreport1.Report.Load(Request.PhysicalApplicationPath + "/reports/harvest_doc1.frx")
fastreport1.RegisterData(dt, dt.TableName)
fastreport1.Prepare()
Dim export1 As New FastReport.Export.Pdf.PDFExport
fastreport1.Report.Export(export1, "d:\result.pdf")
Comments
Thank you for your detailed reply, it is much apreciated.. Can ypu explain to me the use of HttpResponseMessage(HttpStatusCode.OK)
Iadded the line and Iwas required to create a class, after creating this I get errors at each response.Content line.
I have not had a lot of experience dealing with this.
I have attatched a file of my code
https://docs.microsoft.com/en-us/aspnet/web.../action-results
http://www.c-sharpcorner.com/UploadFile/03...e-in-webapi166/
code in html page
code in webapi
html page
web.config
pdfhandler.vb
thank you very much for all your help
Regards
Duncan