Posted 11 June 2018, 3:39 am EST
Is there a way I can print multiple lines in a header and footer?
Thanks,
Luis
Forums Home / Spread / Spread for WPF/Silverlight
Posted by: Luis.Alvarez on 11 June 2018, 3:39 am EST
Posted 11 June 2018, 3:39 am EST
Is there a way I can print multiple lines in a header and footer?
Thanks,
Luis
Posted 11 June 2018, 9:47 pm EST
Hello Luis,
Could you please clarify that are you talking about printing multi line header text and multi line footer text while printing SpreadSheet OR are you talking about having multiple column headers in SpreadSheet?
Please confirm and elaborate. We will further look into your issue accordingly.
Thanks,
Reeva
Posted 11 June 2018, 10:21 pm EST
Hi Luis,
You can have multiline text in print header using the newline character in the header string. For example:
GrapeCity.Windows.SpreadSheet.Data.PrintInfo printset = new GrapeCity.Windows.SpreadSheet.Data.PrintInfo();
printset.FirstPageNumber = 5;
//multiline header string
printset.HeaderLeft = "First Line" + Environment.NewLine + "Second List";
printset.HeaderRight = "right";
printset.FooterCenter = "Footer Center";
printset.FooterLeft = "Footer Left";
printset.FooterRight = "Footer Right";
gcSpreadSheet1.Sheets[0].PrintInfo = printset;
gcSpreadSheet1.SavePdf(Environment.CurrentDirectory + @"\\..\\..\\test.pdf", 0);
I hope it helps.
Thanks,
Deepak Sharma
Posted 12 June 2018, 12:13 am EST
Deepak,
Thanks for your answer. Unfortunately does not work. I get one line only. By the way, I’m using Spread.NET Version 11.0. Awaiting for the release of the fix to install Version 11.1.
Luis
Posted 12 June 2018, 6:10 pm EST
Hi Luis,
You can download the fixed build from the link below and install latest version:
https://cdn.grapecity.com/SpreadNET/installer/current/offlineDownload_Full.zip
Also, I have created a sample application where the print header shows multiline text using the code as shown above. Please test the same and let me know in case you face any issues.
Thanks,
Deepak SharmaSpreadWPFMultiLinepPrintheader.zip
Posted 13 June 2018, 12:37 am EST
Deepak,
I downloaded and installed the fix build. Then I ran your sample program and it works for the SavePdf method. I then added gcSpreadSheet1.Print(); right above gcSpreadSheet1.SavePdf and the printed pages do not show a multiple lines for the header. See attached pdf.
Posted 13 June 2018, 12:38 am EST
Posted 13 June 2018, 11:16 pm EST
Hello,
I am able to replicate this issue at my end. I have submitted it as a bug to the development team for further investigation. The bug id for this issue is:
259542.
I will let you know as soon as I get an update on this issue.
Thanks,
Deepak Sharma
Posted 15 June 2018, 3:58 am EST
Deepak,
Can you also add unable to print using a landscape page orientation to the bug id? I used “printinfo.Orientation = PrintPageOrientation.Landscape” but I’m always getting a portrait page.
Luis
Posted 17 June 2018, 11:11 pm EST
Hi Luis,
I have updated the bug with the orientation issue as well. I will inform you once I get any news on this.
Thanks,
Deepak Sharma
Posted 27 June 2018, 10:26 pm EST
Hello,
Our developers are working on the multiline page header printing issue.
Where as the print orientation issue has been identified as the limitation of Spread WPF/SL. The PrintInfo.Orientation only effects when printing to document, when printing through a printer, it will use the settings of the system printing dialog.
Thanks,
Deepak Sharma