-
Oct 15th, 2010, 02:45 AM
#1
Thread Starter
Addicted Member
[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
-
Oct 15th, 2010, 08:04 AM
#2
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.
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
-
Oct 15th, 2010, 08:17 AM
#3
Thread Starter
Addicted Member
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
-
Oct 15th, 2010, 08:52 AM
#4
Re: [RESOLVED] report.render deviceinfo - Image Device Information Settings (Landscap
Cool, I didn't know you could do that.
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
-
Oct 15th, 2010, 09:53 AM
#5
Thread Starter
Addicted Member
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|