[RESOLVED] report.render deviceinfo - Image Device Information Settings (Landscape????)
How can I get the report to print in landscape?
I changed the width to 11inches, but all it does now is shrink the page to fit a portrait a4...
Its a vb.net console app.
Here is what I tried:
vb Code:
' Export the given report as an EMF (Enhanced Metafile) file.
Private Sub Export(ByVal report As LocalReport)
Dim deviceInfo As String = "<DeviceInfo>" & _
"<OutputFormat>EMF</OutputFormat>" & _
"<Orientation>Landscape</Orientation>" & _
"<PageWidth>11in</PageWidth>" & _
"<PageHeight>8.5in</PageHeight>" & _
"<MarginTop>0.25in</MarginTop>" & _
"<MarginLeft>0.25in</MarginLeft>" & _
"<MarginRight>0.25in</MarginRight>" & _
"<MarginBottom>0.25in</MarginBottom>" & _
"</DeviceInfo>"
Dim warnings As Warning()
m_streams = New List(Of Stream)()
report.Render("Image", deviceInfo, AddressOf CreateStream, warnings)
For Each stream As Stream In m_streams
stream.Position = 0
Next
End Sub
Re: report.render deviceinfo - Image Device Information Settings (Landscape????)
You have to change the printer settings. Landscape changes the orientation by 90 degrees. Changing the width does just that, changes the width.
Re: report.render deviceinfo - Image Device Information Settings (Landscape????)
I got it working here:
vb Code:
Private Sub Print()
If m_streams Is Nothing OrElse m_streams.Count = 0 Then
Throw New Exception("Error: no stream to print.")
End If
Dim printDoc As New PrintDocument()
If Not printDoc.PrinterSettings.IsValid Then
Throw New Exception("Error: cannot find the default printer.")
Else
AddHandler printDoc.PrintPage, AddressOf PrintPage
m_currentPageIndex = 0
Dim PRINTERNAME As String = My.Computer.FileSystem.ReadAllText(".\printersettings.ini")
printDoc.PrinterSettings.PrinterName = PRINTERNAME
printDoc.DefaultPageSettings.Landscape = True
printDoc.Print()
End If
End Sub
vb Code:
printDoc.DefaultPageSettings.Landscape = True
Re: [RESOLVED] report.render deviceinfo - Image Device Information Settings (Landscap
Cool, I didn't know you could do that.
Re: [RESOLVED] report.render deviceinfo - Image Device Information Settings (Landscap
haha neither did I, but found something similar in C# and modified it a bit.