在 C# 中打印或预览时如何更改 AdvanceDGV 的方向

How to change orientation of AdvanceDGV when printing or previewing in c#

我正在尝试在打印时更改页面方向

我刚刚下载了 ADGV 来轻松打印 GRIDS,但我不知道如何更改方向

DGVPrinter printer = new DGVPrinter();
        printer.Title = "NGP Report";
        printer.TitleFont = new Font("Segoe UI", 14, FontStyle.Bold);
        printer.SubTitleFont = new Font("Segoe UI", 13);
        printer.TitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
        printer.PorportionalColumns = true;
        printer.Footer = "Total Rows - " + totalss();
        printer.HeaderCellAlignment = StringAlignment.Near;
        printer.KeepRowsTogether = true;
        printer.FooterSpacing = 15;
        printer.ColumnWidth = DGVPrinter.ColumnWidthSetting.CellWidth;
        printer.PrintPreviewDataGridView(advancedDataGridView1);

你可以像这样更改 PrintDocument() 的设置

printDocument1.DefaultPageSettings.Landscape = true;