Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am exporting excel using EPPLUS. i want to do print setting throuhg code. I have tried it also but problem is that if there are so many columns on excel then print is not readable it looks to small. when i increase the excel cell font then only it is readable but i want normal font on excel and print make readable..is there any solution?
i have tried following:

C#
worksheet.Cells.Style.Font.Size = 14;
worksheet.Cells.Style.Font.Name = "Veranda";
worksheet.Cells.Style.WrapText = true;
worksheet.Row(1).Style.WrapText = true;
worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
worksheet.PrinterSettings.FitToPage = true;
worksheet.PrinterSettings.FitToHeight = 150;
worksheet.PrinterSettings.Orientation = eOrientation.Landscape;


I have set font 14 to look print readable but actually i want font 10 and print will look readable.
Posted
Comments
Herman<T>.Instance 3-Feb-15 3:59am    
remove:
worksheet.PrinterSettings.FitToPage = true;
worksheet.PrinterSettings.FitToHeight = 150;

they set it to 1 page

1 solution

Solution to your problem lies within your code. As you have set the paper size to A4 and set the FitToPage property to true, when no of columns increases this property tries to squeeze all the columns in A4 page which make the cell contents hard to read. You can try the following:
1. Remove the property FitToPage = true.
2. Change the paper size of sheet i.e. set paper size to A3 for example that will make cell contents more readable.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900