Printing Issues

Posted by: Luis.Alvarez on 25 April 2018, 12:47 am EST

  • Posted 25 April 2018, 12:47 am EST

    I have the need to change the page orientation between landscape and portrait depending on the number of spreadsheet columns. I have tried to set the orientation using and then assigning the printinfo object
    Dim printinfo As New PrintInfo()
    ' Set the deafult Print Dialog Box options
    printinfo.Orientation = PrintPageOrientation.Landscape
    GcSpreadSheet1.Sheets(0).PrintInfo = printinfo
    but I'm always getting a portrait orientation. Also is there a way to add a new line to the Header and footer so that I can print multiple lines?

    Thank you,
  • Marked as Answer

    Replied 25 April 2018, 10:57 pm EST


    I test the code below to print in Landscape mode and it works absolutely fine:

     GrapeCity.Windows.SpreadSheet.Data.PrintInfo printset = new GrapeCity.Windows.SpreadSheet.Data.PrintInfo();
    printset.Orientation = GrapeCity.Windows.SpreadSheet.Data.PrintPageOrientation.Landscape;
    printset.PageOrder = GrapeCity.Windows.SpreadSheet.Data.PrintPageOrder.Auto;
    printset.PageRange = "1-3";
    printset.PaperSize = new GrapeCity.Windows.SpreadSheet.Data.PaperSize(System.Drawing.Printing.PaperKind.A4);
    //printset.PaperSize = new GrapeCity.Windows.SpreadSheet.Data.PaperSize(600, 300);
    //printset.PaperSize = new GrapeCity.Windows.SpreadSheet.Data.PaperSize();
    gcSpreadSheet1.Sheets[0].PrintInfo = printset;
    gcSpreadSheet1.SavePdf("C:\\Data\\testportrait.pdf", 0);

    I tested it for latest version. Please refer to the sample application attached.

    Deepak Sharma
  • Replied 25 April 2018, 10:57 pm EST

    Here is the attachment.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels