Printing excel files in C# starts to support in Spire.XLS 7.5.3

We are glad to announce a new hotfix version of Spire.XLS for new features and bug solutions. The important feature of printing excel files has been added in this version. And we also add other new features and enhancements in this version. Details are as followed:

New features:

  • Add a new feature to auto fit all columns of pivot table.
  • Add a new feature to set "Enable show details", "Refresh data when opening the file" for data of Pivot table.
  • Add a new feature to print Excel file.

Code snippet of print excel file:

Workbook workbook = new Workbook();
workbook.LoadFromFile(inputFile);
PrintDialog dialog = new PrintDialog();
dialog.AllowPrintToFile = true;
dialog.AllowCurrentPage = true;
dialog.AllowSomePages = true;
dialog.AllowSelection = true;
dialog.UseEXDialog = true;
dialog.PrinterSettings.Duplex = Duplex.Simplex;
dialog.PrinterSettings.FromPage = 0;
dialog.PrinterSettings.ToPage = 8;
dialog.PrinterSettings.PrintRange = PrintRange.SomePages;
workbook.PrintDialog = dialog;
PrintDocument pd = workbook.PrintDocument;
if (dialog.ShowDialog() == DialogResult.OK)
{ pd.Print(); }

Bug solutions:

  • Fix the issue that all icons of conditional formatting were lost when opening and saving .xlsx file.
  • Fix the issue that auto fit function didn't work in converting Excel to PDF.

Welcome to experience Spire.XLS 7.5.3 with downloading here:

http://www.e-iceblue.com/Download/download-excel-for-net-now.html