Report measurement options

Report measurement options in the Bold Reports® ASP.NET Core Report Viewer improve the appearance of reports in rendering and export output. Set the MeasureTextOption and RoundLayoutMeasures properties in the Report Viewer Web API controller.

How do I improve text rendering in view and export?

To improve text rendering in view and export, set the MeasureTextOption property in the ASP.NET Core Report Viewer. The property provides the following improvements in text rendering:

  • Produces identical text sizes in view and export output.
  • Improves rendering performance.
  • Eliminates text overlaps.
  • Allows to measure text with user-defined or custom fonts.

To enable these benefits, set the MeasureTextOption property value to PdfFont in OnInitReportOptions of the Report Viewer Web API controller, as in the following code snippet:

```csharp
[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
  reportOption.ReportModel.MeasureTextOption = MeasureTextOptions.PdfFont;
}
```

The PdfFont measurement option uses the custom fonts added in the reportOption.ReportModel.PDFOptions.Fonts collection.

How do I improve report item layout and pagination?

To improve report item layout and pagination in the ASP.NET Core Report Viewer, set the RoundLayoutMeasures property to false. When the RoundLayoutMeasures property is false, all non-integral values that are calculated during the report processing are rounded to whole pixel values. Rounding provides the following improvements:

  • Report text rendered without cuts.
  • Eliminates extra blank pages.
  • Removes item and text overlaps.
  • Eliminates the blur semi-transparent edges that are produced by anti-aliasing.
  • Produces identical look in report view and export output.

To enable these benefits, set the RoundLayoutMeasures property value to false in OnInitReportOptions of the Report Viewer Web API controller, as in the following code snippet:

```csharp
[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
  reportOption.ReportModel.RoundLayoutMeasures = false;
}
```

See also