none
To print a reportviewer in landscape RRS feed

  • Question

  •  Hi everyone, I am trying to have a report print in landscape and i do not know where to start.  This is how i have approached it so far

    Dim ds As New DataSet

    ds = GetActivitySheet() This is a call to my function that fills the dataset

    ReportViewer1.ProcessingMode = ProcessingMode.Local

    Dim rep1 As LocalReport = ReportViewer1.LocalReport

    rep1.ReportPath = Server.MapPath("Reports\UniformrptActivitySheet.rdlc")

    Dim dsActSheet As New ReportDataSource

    dsActSheet.Name = "ActivitySheet_dtActSheet"

    dsActSheet.Value = ds.Tables(0)

    rep1.DataSources.Clear()

    rep1.DataSources.Add(dsActSheet)

    rep1.Refresh()

    dsActSheet = Nothing

    ds = Nothing

    My dataset comes from and SQL Table. Can someone please help.

    Monday, October 13, 2008 8:27 PM

All replies

  • This is actually very simple and you don't need code to do it.  (You could, I guess)
    You need to go into the rdlc page properties and set the PageSize to Width: 11in, Height: 8.5in or whatever measurements the landscape report needs. 

    This is very poorly documented in VS.

    If you need to let the user toggle between Landscape and Portrait, the only way I've found is to create two separate reports, but if it is a fairly simple report you could generate the code at runtime.

    Hope that helps.
    • Proposed as answer by dbGeek Monday, October 13, 2008 9:17 PM
    Monday, October 13, 2008 9:16 PM
  • Thank you very much for the help. It does work perfectly.

    Trafmore
    Tuesday, October 14, 2008 2:39 PM