1
votes

I'm using SSRS to generate reports in my app. My app calls the web service behind the scenes. In some cases I render the report using the ReportViewer web control, in other cases (if user is using Webkit based browser for example), I just allow them to download a pdf of the report. I set the report parameters programatically.

How can I give my users the ability to decide on the layout of the page (margins, landscape/portrait, paper size)? Is there someway to configure the report layout using report params?

The ability to choose between Letter and Legal is my main interest.

Alternative is to build 2 version of each report but I hate repetition.

1
Why cant they make these types of choices in the PDF themselves?Irwin M. Fletcher
If the pdf was rendered to 8.5x11, your pdf viewer can't change the height/width ratio of each page. All it can do is crop or enlarge.srmark

1 Answers

0
votes

As far as I know, if your are using the ReportViewer here's how to do it:

reportViewer.SetPageSettings(new PageSettings()
{
  Landscape = false,
  Margins = new Margins()
  {
    Left = 1,
    Top = 1,
    Right = 1,
    Bottom = 1,
  },
  PaperSize = new PaperSize()
  {
    Height = 1100,
    Width = 850,
    RawKind = (int)PaperKind.Letter,
  }
});

Hope this helps..