This topic explains the list of custom properties that are supported at the report level to control the export behaviour in ASP.NET Core Report Viewer.
The custom property DisableExcelCellFormat
helps to improve the excel export performance by ignoring the rendering of report item styles. It allows property value from anyone of the following values.
Style
- Disables rendering of the cell styles like padding, background, color, and text styleBorder
- Disables rendering of the cell borderAll
- Disables rendering of the cell border, padding, background, color, and text styleSet the property value as
All
to improve maximum excel export performance.
You can set the DisableExcelCellFormat
custom property as shown below,
The
DisableExcelCellFormat
property must be added to report properties.
Set ExcelLayoutOption
custom property value as IgnoreCellMerge
to improve the readability of the excel document by eliminating the tiny columns, rows, and merged cells. You can set the property value, as shown below,
The
ExcelLayoutOption
property must be added to report properties.
The PdfConformanceLevel
allows you set PDF document versions.
You can set anyone of the following PDF conformance option.
Pdf_A1B
- You can create a Pdf_A1B
document by specifying the conformance level as Pdf_A1B
through PdfConformanceLevel
Enum when creating the new PDF document.Pdf_A2B
- You can create a Pdf_A2B
document by specifying the conformance level as Pdf_A2B
through PdfConformanceLevel
Enum when creating the new PDF documentPdf_A3B
- The PDF_A3B
conformance supports the external files as attachment to the PDF document, so you can attach any document format such as Excel, Word, HTML, CAD, or XML files.Pdf_A1A
- This conformance includes all Pdf_A1B
requirements in addition to the features intended to improve a document’s accessibility. PDF/A-1a
conformance additionally have crucial properties of Tagged PDF.Pdf_A2A
- This conformance includes all PDF_A2B
requirements in addition to the features intended to improve a document’s accessibility. PDF/A-2a
conformance additionally have crucial properties of Tagged PDF.Pdf_A2U
- This conformance includes all Pdf_A2U
requirements, and additionally Unicode mapping for all text in the document.Pdf_X1A2001
- You can create a PDF/X-1a
document by specifying the conformance level as Pdf_X1A2001
through PdfConformanceLevel
Enum when creating the new PDF document.You can set the PdfConformanceLevel
custom property as shown below,
The EnableComplexScript
custom property allows you to export pdf documents with complex script language texts.
You can set the property value, as shown below,
The EnableUniqueResourceNaming
property allows you to create a PDF document with proper uniform resource naming. By default, the resource naming is added uniquely. Disabling the EnableUniqueResourceNaming
property will create a PDF document with uniform resource names.
You can set the property value as shown below:
The MeasureTextOptions
property allows you to specify how text size is measured during PDF export. This property supports the following options:
PdfFont
- Text size is measured using the Pdf Font element, ensuring accurate measurement based on the font used in the document.Default
- Text size is measured using a framework element, providing a more general approach to text measurement.You can configure the Measure Text Options property based on your requirements to ensure proper text rendering in the exported PDF document.
You can set the property value as shown below:
The EnableTableOfContents
property adds a table of contents to the exported PDF. It utilizes the document structure defined in the report to generate the table of contents, making it easier to navigate through the content.
Enable this property to include a structured table of contents in your PDF exports.
First, you need to configure the document map for report. Refer to Configure Document Map, then set the property value as shown below:
The custom property DocumentOpenPassword
allows you to protect the exported document such as PDF, Word, and Excel from unauthorized users by encrypting the document using the encryption password.
You can set the property value, as shown below,
open the pdf document and see the below output.
The custom property WordProtectionType
allows you to restrict a Word document from editing either by providing a password or without a password by using following types of protection.
AllowOnlyComments
- You can add or modify only the comments in the Word document.AllowOnlyFormFields
- You can modify the form field values in the Word document.AllowOnlyRevisions
- You can accept or reject the revisions in the Word document.AllowOnlyReading
- You can only view the content in the Word document.NoProtection
- You can access or edit the Word document contents as normally.You can set the WordProtectionType
custom property as shown below,
The custom property DocumentEditPassword
helps to allow specific users permission to modify the workbook data and save changes to the file in the excel document.
You can set the property value, as shown below,
open the excel document and see the below output.
The custom property RowHeightType
allows you to customize row height for a tablix item in word document by using the following types.
Exactly
- The row height is fixed to a specified value. The row will not expand even if the content inside it requires more space.AtLeast
- The row height is set to a minimum value. The row can expand if the content inside it requires more space, ensuring that all content is visible.You can set the RowHeightType
custom property as shown below:
The custom property ExcelProtectionType
allows you to protect the worksheet of excel document either by providing a password or without a password by using following types of protection.
None
- Represents no protection in excel sheetObjects
- allows to protect shapes in excel sheetScenarios
- allows to protect scenarios.FormattingCells
- allows the user to format any cell on a protected worksheet.FormattingColumns
- allows the user to format any column on a protected worksheet.FormattingRows
- allows the user to format any rows on a protected worksheet.InsertingColumns
- allows the user to insert columns on the protected worksheet.InsertingRows
- allows the user to insert rows on the protected worksheet.InsertingHyperlinks
- allows the user to insert hyperlinks on the worksheet.DeletingColumns
- allows the user to delete columns on the protected worksheet, where every cell in the column to be deleted is unlocked.DeletingRows
- allows the user to delete rows on the protected worksheet, where every cell in the row to be deleted is unlocked.LockedCells
- allows to protect locked cells.Sorting
- allows the user to sort on the protected worksheetFiltering
- allows the user to set filters on the protected worksheet. Users can change filter criteria but can not enable or disable an auto filter.UsingPivotTables
- allows the user to use pivot table reports on the protected worksheet.UnLockedCells
- allows to protect the user interface, but not macros.Content
- allows to protect the contents in the excel sheet.All
- allows to protect all type of protection.You can set the ExcelProtectionType
custom property as shown below,
The custom property EnableCommentsForExcel
enables the display of report item tooltip content as comments in Excel exports. When enabled, Tooltip associated with report items will be included as comments within the exported Excel file, providing additional context for users.
First, you need to set the tooltip for report item. Refer to Set Tooltip, then set the property value as shown below:
Open the Excel document and see the output below:
Below are descriptions of the three properties related to handling print page settings in Excel documents.
Property | Description |
---|---|
FitToPagesTall |
Similar to the previous property, this one also aims to fit all content on a single page including images and charts, to ensure everything fits. Set an integer value of either 0 or 1. |
FitToPagesWide |
Determines whether the content of the worksheet should be scaled to fit the width of a single page during printing. Set an integer value of either 0 or 1. |
IsFitToPage |
Determines whether the content of the worksheet should be scaled to fit on a single page during printing when set as True . Excel will adjust the printout to fit within the specified page dimensions. |
For choosing the page layout in the print settings:
FitToPagesWide
as 1
and FitToPagesTall
as 0
.FitToPagesWide
as 0
and FitToPagesTall
as 1
.IsFitToPage
as true
.You can set the property value as shown below:
The HideUnusedColumns
property removes unused or empty columns from the exported Excel file. This ensures a cleaner and more organized output by excluding unnecessary columns.
You can set the property value as shown below:
Before enabling the hide unused columns property, the rows will be displayed as shown below.
Preview the Excel document and note that unused rows have been hidden.
The EliminateHeader
property allows you to exclude the header of the tablix when exporting to CSV format. By enabling this property, the tablix headers will not appear in the exported CSV file, providing a clean data output.
You can set the property value as shown below:
Before enabling the eliminate header property, the row header will be displayed as shown below.
Preview the Excel document, and note that header have been eliminated.