Posted 24 July 2019, 9:09 am EST - Updated 4 October 2022, 1:02 am EST
Hi,
I am trying to use the print preview method of printinfo class. In my code the user selected row needs to be previewed. Below is the code i use:
grdScl.PrintInfo.PageSettings.PrinterSettings.Collate = false;
grdScl.PrintInfo.PageSettings.PrinterSettings.Copies = 1;
grdScl.PrintInfo.PageHeaderStyle.Font = new Font(grdScl.PrintInfo.PageHeaderStyle.Font.FontFamily,14,grdScl.PrintInfo.PageHeaderStyle.Font.Style,grdScl.PrintInfo.PageHeaderStyle.Font.Unit,grdScl.PrintInfo.PageHeaderStyle.Font.GdiCharSet,grdScl.PrintInfo.PageHeaderStyle.Font.GdiVerticalFont);
grdScl.PrintInfo.PageHeader = "\t Schedules ";
grdScl.PrintInfo.PreviewFormClassName = (“SCHEDULES PRINTPREVIEW”);
grdScl.PrintInfo.RepeatColumnHeaders = true;
grdScl.PrintInfo.PageFooter = “\t Page \p of \P”;
grdScl.PrintInfo.PageSettings = PageSettings;
grdScl.PrintInfo.PrintPreview();
As soon as code reaches print preview method. I get a dialog box saying processing document and nothing happens. I dont get the preview page.
Note that I have 25 columns in my grid.
I have attached screenshot for reference. Please help.
Regards,
Kshitiz