Last post Jul 12, 2017 07:56 AM by Deepak Panchal
Jul 11, 2017 01:03 PM|siva26prakash|LINK
My requirement it to design RDLC reports with parameters and populating date to parameter at run time and printing them to selected printer.
I set width and Height in RDLC report and i would like to print the report with same dimension.
But it always prints with printer's default page dimension.
One thing i noticed is, even if i give different page with and height of deviceinfo parameter in the LocalReport.Render() method, it prints with printers default dimension.
How to pass deviceinfo properties to get stream in expected dimension?
Jul 12, 2017 07:56 AM|Deepak Panchal|LINK
you can try to use code below may help you.
PageSettings ps = new PageSettings(); //Declare a new PageSettings for printing
ps.Landscape = false; //Set True for landscape, False for Portrait
ps.Margins = new Margins(0, 0, 0, 0); //Set margins
//Choose paper size from the paper sizes defined in ur printer.
//Here we use Linq to quickly choose by name
(from PaperSize p
where p.PaperName == "Legal" select p).First();
//Alternatively you can set the paper size as custom
//ps.PaperSize = new PaperSize("MyPaperSize", 100, 100);