Export custom properties

Export custom properties in the Bold Reports® ASP.NET Web Forms Report Viewer control export behavior at the report level, such as Excel performance, PDF conformance and document passwords.

How do I improve Excel export performance?

To improve Excel export performance in the Report Viewer, set the DisableExcelCellFormat custom property, which ignores the rendering of report item styles. The property accepts one of the following values.

  • Style - Disables rendering of the cell styles like padding, background, color, and text style.
  • Border - Disables rendering of the cell border.
  • All - Disables rendering of the cell border, padding, background, color, and text style.

Set the property value as All to improve maximum excel export performance.

You can set the DisableExcelCellFormat custom property. Shows the configuration of disabling excel cell format in custom property dialog

The DisableExcelCellFormat property must be added to report properties.

How do I improve Excel export readability?

To improve the readability of the Excel document in the Report Viewer, set the ExcelLayoutOption custom property value to IgnoreCellMerge, which eliminates the tiny columns, rows and merged cells. You can set the property value. Shows configuration of excel layout option property in custom property dialog

The ExcelLayoutOption property must be added to report properties.

How do I set the PDF conformance level?

To set the PDF document version in the Report Viewer, use the PdfConformanceLevel custom property.

You can set any one of the following PDF conformance options.

  • 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 document.
  • Pdf_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.

Shows the configuration of pdf conformance level in custom property dialog

How do I export PDF documents with complex script?

To export PDF documents with complex script language text in the Report Viewer, set the EnableComplexScript custom property. You can set the property value.

Shows configuration of enable complex script property in custom property dialog

How do I control resource naming in PDF export?

To control resource naming in exported PDF documents in the Report Viewer, set the EnableUniqueResourceNaming property. 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:

Shows configuration of enable unqiue resource name property in custom property dialog

How do I encrypt exported documents with a password?

To protect exported PDF, Word and Excel documents from unauthorized users in the Report Viewer, set the DocumentOpenPassword custom property, which encrypts the document with the password. You can set the property value.

Shows configuration of document open password property in custom property dialog

Open the PDF document to see the output.

preview of document open password property in pdf export

How do I protect a Word document from editing?

To restrict editing of an exported Word document in the Report Viewer, set the WordProtectionType custom property, with or without a password, to one of the following protection types.

  • 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.

Shows the configuration of word protection type in custom property dialog

How do I customize row height in a Word document?

To customize the row height of a tablix item in an exported Word document, set the RowHeightType custom property in the Report Viewer to one of 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:

Shows the configuration of word protection type in custom property dialog

How do I set an Excel document edit password?

To let specific users modify the workbook data and save changes in an exported Excel document, set the DocumentEditPassword custom property in the Report Viewer. You can set the property value.

Shows the configuration of document edit password in custom property dialog

Open the Excel document to see the output.

preview of document open password property in pdf export

How do I protect an Excel worksheet?

To protect the worksheet of an exported Excel document in the Report Viewer, set the ExcelProtectionType custom property, with or without a password, to one of the following protection types.

  • None - Represents no protection in excel sheet.
  • Objects - allows to protect shapes in excel sheet.
  • Scenarios - 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 worksheet.
  • Filtering - 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.

Shows the configuration of Excel protection type in custom property dialog

How do I add comments to an Excel document?

To show report item tooltip content as comments in Excel exports, enable the EnableCommentsForExcel custom property in the Report Viewer. When enabled, tooltips 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:

Shows the configuration of enabling comments for excel document in custom property dialog

Open the Excel document to see the output:

preview of enable comments property in excel export

How do I set print page settings for an Excel document?

To handle print page settings in exported Excel documents, use the following three Report Viewer properties.

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:

  • To Fit All Columns On One Page: Need to set the API FitToPagesWide as 1 and FitToPagesTall as 0.
  • To Fit All Rows On One Page: Need to set the API FitToPagesWide as 0 and FitToPagesTall as 1.
  • To Fit sheet on one page : Need to set the API IsFitToPage as true.

You can set the property value:

Shows the configuration of document print page layout in custom property dialog