on 02-19-2019 6:16 AM
Hello everybody
i'm writing this thread because in this period on my web app deployed with asp.net and vb.net i have on my IIS an error called "Database access failed" when someone try to create a report.
I can attach my code because i have tried some tentatives but i didn't solve anything.
The only choise to restart export reports is a IIS reset command on my Internet Information Service.
I hope someone can help me to solve my problem.
Here my code to export a report:
Dim da as new Data.SqlClient.SqlDataAdapter
dim rptDocument as ReportDocument
dim connection = "connection to my database"
da.SelectCommand = New SqlCommand(ssql, connection) //here my query with my connection
da.Fill(ds, table) //declared dataset and table
reportPath = path
rptDocument = New ReportDocument
rptDocument.Load = reportPath //path where is my report
rptDocument.SetDataSource(ds)
// Then here i do other queries to export a logo and then
rptDocument.OpenSubreport("RPT_Logo.rpt").setDataSource(ds1)
dim exportOpts as ExportOptions = new ExportOptions()
dim pdfRtfWordOpts as PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
dim destinationOpts as DiskFileDestionationOptions = ExportOptions.CreateDiskFileDestinationOptions()
exportOpts.ExportFormatOptions = pdfRtfWordOpts
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
destinationOpts.DiskFileName = mypath
exportOpts.ExportDestinationOptions = destinationOpts
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
rptDocument.Export(exportOpts)
rptDocument.Close()
rptDocument.Dispose()
Make sure the dataset matches the report exactly.
Does it work in CR Designer?
Need more details on on the work flow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.