PageSettings ps = new PageSettings(); //Declare a new PageSettings for printing
ps.Landscape = false; //Set True for landscape, False for Portrait
ps.Margins = new Margins(47, 43, 149, 1); //Set margins
//Choose paper size from the paper sizes defined in ur printer.
//Here we use Linq to quickly choose by name
ps.PaperSize =
(from PaperSize p
in ps.PrinterSettings.PaperSizes
where p.PaperName == "Legal"
select p).First();
//Alternatively you can set the paper size as custom
//ps.PaperSize = new PaperSize("MyPaperSize", 100, 100);
reportViewer1.SetPageSettings(ps);
this.reportViewer1.LocalReport.DisplayName = "Report Name";
ps.Landscape = false; //Set True for landscape, False for Portrait
ps.Margins = new Margins(47, 43, 149, 1); //Set margins
//Choose paper size from the paper sizes defined in ur printer.
//Here we use Linq to quickly choose by name
ps.PaperSize =
(from PaperSize p
in ps.PrinterSettings.PaperSizes
where p.PaperName == "Legal"
select p).First();
//Alternatively you can set the paper size as custom
//ps.PaperSize = new PaperSize("MyPaperSize", 100, 100);
reportViewer1.SetPageSettings(ps);
Report Dynamic File name while saving into PDF/word/excel
this.reportViewer1.LocalReport.DisplayName = "Report Name";
No comments:
Post a Comment