Results 1 to 5 of 5

Thread: [RESOLVED] report.render deviceinfo - Image Device Information Settings (Landscape????)

  1. #1

    Thread Starter
    Addicted Member tgf-47's Avatar
    Join Date
    Feb 2010
    Location
    CapeTown, South Africa -34.01244,18.337415
    Posts
    209

    Resolved [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:
    1. ' Export the given report as an EMF (Enhanced Metafile) file.
    2.     Private Sub Export(ByVal report As LocalReport)
    3.         Dim deviceInfo As String = "<DeviceInfo>" & _
    4.             "<OutputFormat>EMF</OutputFormat>" & _
    5.             "<Orientation>Landscape</Orientation>" & _
    6.             "<PageWidth>11in</PageWidth>" & _
    7.             "<PageHeight>8.5in</PageHeight>" & _
    8.             "<MarginTop>0.25in</MarginTop>" & _
    9.             "<MarginLeft>0.25in</MarginLeft>" & _
    10.             "<MarginRight>0.25in</MarginRight>" & _
    11.             "<MarginBottom>0.25in</MarginBottom>" & _
    12.             "</DeviceInfo>"
    13.         Dim warnings As Warning()
    14.         m_streams = New List(Of Stream)()
    15.         report.Render("Image", deviceInfo, AddressOf CreateStream, warnings)
    16.         For Each stream As Stream In m_streams
    17.             stream.Position = 0
    18.         Next
    19.     End Sub

  2. #2
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    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

  3. #3

    Thread Starter
    Addicted Member tgf-47's Avatar
    Join Date
    Feb 2010
    Location
    CapeTown, South Africa -34.01244,18.337415
    Posts
    209

    Re: report.render deviceinfo - Image Device Information Settings (Landscape????)

    I got it working here:
    vb Code:
    1. Private Sub Print()
    2.         If m_streams Is Nothing OrElse m_streams.Count = 0 Then
    3.             Throw New Exception("Error: no stream to print.")
    4.         End If
    5.         Dim printDoc As New PrintDocument()
    6.         If Not printDoc.PrinterSettings.IsValid Then
    7.             Throw New Exception("Error: cannot find the default printer.")
    8.         Else
    9.             AddHandler printDoc.PrintPage, AddressOf PrintPage
    10.             m_currentPageIndex = 0
    11.             Dim PRINTERNAME As String = My.Computer.FileSystem.ReadAllText(".\printersettings.ini")
    12.  
    13.             printDoc.PrinterSettings.PrinterName = PRINTERNAME
    14.             printDoc.DefaultPageSettings.Landscape = True
    15.             printDoc.Print()
    16.         End If
    17.     End Sub
    vb Code:
    1. printDoc.DefaultPageSettings.Landscape = True

  4. #4
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    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

  5. #5

    Thread Starter
    Addicted Member tgf-47's Avatar
    Join Date
    Feb 2010
    Location
    CapeTown, South Africa -34.01244,18.337415
    Posts
    209

    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
  •  



Click Here to Expand Forum to Full Width