Excel Printing

I am using the following code and it is not printing on 1 page wide. Is this implememented? Thanks, Eddie sheet.PageSetup.Orientation = ExcelPageOrientation.Landscape; sheet.PageSetup.PrintArea="$A$1:$N$11"; sheet.PageSetup.CenterHorizontally=true; sheet.PageSetup.CenterVertically=true; sheet.PageSetup.FitToPagesWide = 1;

1 Reply

AD Administrator Syncfusion Team December 1, 2005 07:15 AM UTC

Hi Eddie, Your code is correct but it does not work since there is a bug with setting FitToPagesWide = 1. A workaround for this issues is to set the FitToPagesWide = 2 and then set FitToPagesWide = 1. Please use this workaround till this issue is fixed. Workaround code //Insert Sample Data for(int i=1;i<=30;i++) { for(int j=1;j<30;j++) { sheet.Range[i,j].Text = sheet.Range[i,j].AddressLocal; } } //Set Print Properties sheet.PageSetup.Orientation = ExcelPageOrientation.Landscape; sheet.PageSetup.PrintArea="$A$1:$N$11"; sheet.PageSetup.CenterHorizontally=true; sheet.PageSetup.CenterVertically=true; //Workaround for Bug with setting FitToPagesWide = 1 sheet.PageSetup.FitToPagesWide = 2; sheet.PageSetup.FitToPagesWide = 1; Workaround sample F37806FitPagesWide.zip I have also filed a bug report with the development team http://www.syncfusion.com/support/issues/xlsio/Default.aspx?ToDo=view&questId=1131 Thanks, Stephen.

Loader.
Up arrow icon