Excel Settings
To control how the Bold Reports® ASP.NET Core Report Writer exports Excel documents, set the customization properties in the ExcelOptions. Initialize the ExcelOptions property with the following code snippet:
writer.ExcelOptions = new ExcelOptions();How do I set the Excel document version?
To save the report to the required Excel version with the Report Writer, set the ExcelSaveType property.
writer.ExcelOptions.ExcelSaveType = BoldReports.Writer.ExcelVersion.Excel2013;How do I remove merged cells in Excel exports?
To remove tiny columns, rows and merged cells from an Excel document exported by the Report Writer, set the LayoutOption to IgnoreCellMerge. The layout gives clear readability and lets you perform data manipulations.
writer.ExcelOptions = new BoldReports.Writer.ExcelOptions()
{
LayoutOption = BoldReports.Writer.ExcelLayoutOptions.IgnoreCellMerge
};How do I protect an Excel document from editing?
To restrict an Excel document exported by the Report Writer from editing, set the ExcelSheetProtection property or enable the ReadOnlyRecommended property.
writer.ExcelOptions.ReadOnlyRecommended = true;
writer.ExcelOptions.ExcelSheetProtection = Syncfusion.XlsIO.ExcelSheetProtection.DeletingColumns;How do I change the Excel export format?
To change the default Excel file format of a Report Writer export to any other file format, set the ExcelSaveType property.
writer.ExcelOptions.ExcelSaveType = ExcelVersion.Excel2013;How do I password protect an exported Excel document?
To protect an Excel document exported by the Report Writer from unauthorized users, encrypt it with a password in the PasswordToOpen and PasswordToModify properties. The following code snippet encrypts the exported document with a user-defined password.
writer.ExcelOptions = new BoldReports.Writer.ExcelOptions()
{
PasswordToModify = "password",
PasswordToOpen = "password"
};