Can not print on Single Page dgvprinter c#

Viewed 14

There are 9 columns in datagridview when I print using dgvprinter it prints 7 columns on 1 page and other 2 on a new page. I want to print on a single page anybody helps me? Note: There is an image on datagridview. Here is code:

 DGVPrinter printer = new DGVPrinter();
        printer.Title = "Test";
        printer.SubTitle = "Outgoing Stocks";
        printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
        printer.PageNumbers = true;
        printer.PageNumberInHeader = false;
        printer.PorportionalColumns = true;
        printer.HeaderCellAlignment = StringAlignment.Near;
        printer.Footer = "System generated file";
        printer.FooterSpacing = 15;
        printer.PorportionalColumns = true;
        printer.HeaderCellAlignment = StringAlignment.Near;
        printer.printDocument.DefaultPageSettings.Landscape = true;
        printer.RowHeight = DGVPrinter.RowHeightSetting.CellHeight;
        printer.PrintDataGridView(itemdata_datagridview);
0 Answers
Related