writting code in C# for setting up reportviewer page layout attributes RRS feed

  • Question


    Hi,I have a problem to write a metod in C# for setting up reportviewer page layout attributes before running my project in design time . for example ,i want to write a code in my ReportForm.cs to show my reportviewer layout preview for users to be exactly A4 size or my reportviewer zoom mode to be 50 percent , without let to the users themselves set up output by clicking Page Setup Icon in Toolbar Menu.For Example like this code :

    this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;

    this.reportViewer1.ZoomPercent = 50;

    So I want a sample code for setting up reportviewer page layout attributes before running the program.



    Wednesday, December 5, 2007 1:11 PM

All replies

  • You already have the sample code, I mean you've written it yourself in your message, right?


    Is your question about where to place this code?


    I would use the form Shown event.  (Load is too early for some stuff.)



    Wednesday, December 5, 2007 5:09 PM