Can someone please tell me what is incorrect with the following code. It only fails when the TIFF is one page.
Public
Sub
CreateProcessNotesTIFF()
Dim
instanceReportSource
As
New
Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument =
New
ProcessNotes
instanceReportSource.Parameters.Add(
New
Telerik.Reporting.Parameter(
"ProcNo"
, _procNo))
instanceReportSource.Parameters.Add(
New
Telerik.Reporting.Parameter(
"ApplicantName"
, _applicantName))
Dim
reportProcessor
As
New
Telerik.Reporting.Processing.ReportProcessor()
'set any deviceInfo settings if necessary
Dim
deviceInfo
As
New
System.Collections.Hashtable()
deviceInfo(
"OutputFormat"
) =
"TIFF"
deviceInfo(
"TiffCompression"
) =
"ccitt4"
deviceInfo(
"DpiX"
) = 300
deviceInfo(
"DpiY"
) = 300
'deviceInfo("DpiX") = 120
'deviceInfo("DpiY") = 120
'Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo)
Dim
result
As
Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport(
"IMAGE"
, instanceReportSource, deviceInfo)
Dim
fileName
As
String
= result.DocumentName +
"."
+ result.Extension
'Dim path As String = System.IO.Path.GetTempPath()
Dim
path
As
String
= System.IO.Directory.GetCurrentDirectory()
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
End
Sub
Public
Sub
CreateProcessNotesTIFF()
Dim
instanceReportSource
As
New
Telerik.Reporting.InstanceReportSource()
instanceReportSource.ReportDocument =
New
ProcessNotes
instanceReportSource.Parameters.Add(
New
Telerik.Reporting.Parameter(
"ProcNo"
, _procNo))
instanceReportSource.Parameters.Add(
New
Telerik.Reporting.Parameter(
"ApplicantName"
, _applicantName))
Dim
reportProcessor
As
New
Telerik.Reporting.Processing.ReportProcessor()
'set any deviceInfo settings if necessary
Dim
deviceInfo
As
New
System.Collections.Hashtable()
deviceInfo(
"OutputFormat"
) =
"TIFF"
'deviceInfo("TiffCompression") = "ccitt4"
deviceInfo(
"DpiX"
) = 300
deviceInfo(
"DpiY"
) = 300
'deviceInfo("DpiX") = 120
'deviceInfo("DpiY") = 120
'Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo)
Dim
result
As
Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport(
"IMAGE"
, instanceReportSource, deviceInfo)
Dim
fileName
As
String
= result.DocumentName +
"."
+ result.Extension
'Dim path As String = System.IO.Path.GetTempPath()
Dim
path
As
String
= System.IO.Directory.GetCurrentDirectory()
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
End
Sub