Dear All,
For some days now I am struggling with a problem to export my report to PDF.
using the command "ReportViewer2.ExportReport("PDF", deviceInfo)" there is no problem but I want to name the report and the location dynamically.
using this code
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim savepath As String
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
'set any deviceInfo settings if necessary
Dim deviceInfo As New System.Collections.Hashtable()
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = "Factuur3"
Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", typeReportSource, deviceInfo)
Dim fileName As String = result.DocumentName + "." + result.Extension
Dim path As String = System.IO.Path.GetTempPath()
Dim filePath As String = System.IO.Path.Combine(path, fileName)
Using fs As New System.IO.FileStream(filePath, System.IO.FileMode.Create)
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length)
End Using
savepath = "c\testdir\facturen\"
End Sub
is giving me an error "Invalid reporttype"
Anyone any suggestions?
For some days now I am struggling with a problem to export my report to PDF.
using the command "ReportViewer2.ExportReport("PDF", deviceInfo)" there is no problem but I want to name the report and the location dynamically.
using this code
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim savepath As String
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
'set any deviceInfo settings if necessary
Dim deviceInfo As New System.Collections.Hashtable()
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
' reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = "Factuur3"
Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", typeReportSource, deviceInfo)
Dim fileName As String = result.DocumentName + "." + result.Extension
Dim path As String = System.IO.Path.GetTempPath()
Dim filePath As String = System.IO.Path.Combine(path, fileName)
Using fs As New System.IO.FileStream(filePath, System.IO.FileMode.Create)
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length)
End Using
savepath = "c\testdir\facturen\"
End Sub
is giving me an error "Invalid reporttype"
Anyone any suggestions?