SAP Knowledge Base Article - Public

2332112 - Add a property in Windows.Forms.CrystalReportViewer to control the display quality of OLE object image

Symptom

In Crystal Reports .net Winform Viewer,  OLE object with high resolution image displays in low quality

Environment

  • SAP Crystal Reports, version for Microsoft Visual Studio SP16
  • SAP BusinessObjects BI platform .Net SDK runtime 4.1 SP8
  • SAP BusinessObjects BI platform .Net SDK runtime 4.2 SP2

Reproducing the Issue

  • In Crystal Reports, insert a OLE object with high resolution image
  • View the report in CR .net Windows form viewer.

Cause

This is an enhancement request to take advantage of the multiple resolution capabilities of GDIPlus.dll

Resolution

This issue is fixed in the patches listed in the "Support Packages & Patches" section below.

The "Support Packages & Patches" section will be populated with the relevant patch levels once they are released.

For Business Intelligence Platform maintenance schedule and strategy see the Knowledge Base Article 2144559 in References section.

After applying the patch:

     1. Add a new property: CrystalDecisions.Windows.Forms.CrystalReportViewer.InterpolationMode in order to control the display quality of image.

     2. The default InterpolationMode is set to "System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor".

In C# you can load the values in the FormLoad event:

public frmMain()
{
 //
 // Required for Windows Form Designer support
 //
 InitializeComponent();

    // SP 17 - SAP NOTE 2321691
    //System.Drawing.Drawing2D.InterpolationMode CRInterpolMode = new System.Drawing.Drawing2D.InterpolationMode();
    //CRInterpolMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;

    //crystalReportViewer1.InterpolationMode = CRInterpolMode;

    LstInterpolationMode.Enabled = false;
    Array CRinterpolationMode = Enum.GetValues(typeof(System.Drawing.Drawing2D.InterpolationMode));
    foreach (object obj in CRinterpolationMode)
    {
        //CRInterpolMode.GetTypeCode(CRinterpolationMode);
        LstInterpolationMode.Items.Add(obj);
    }
    LstInterpolationMode.SelectedItem = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
....
}

 Now in the View Report button add this:

private void ViewReport_Click(object sender, EventArgs e)
{
    //// from R&D to handle Viewer OLE Object refresh issue 175343
    //crystalReportViewer1.CachedPageNumberPerDoc = 1;

    // SP 17 - SAP NOTE 2321691
    //System.Drawing.Drawing2D.InterpolationMode CRInterpolMode = new System.Drawing.Drawing2D.InterpolationMode();
    //CRInterpolMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;

    crystalReportViewer1.InterpolationMode = (System.Drawing.Drawing2D.InterpolationMode)LstInterpolationMode.SelectedIndex;
....

 NOTE: One side effect of this update is the Charts may now be higher resolution and appear to be jagged edge.

Keywords

Crystal Reports for Visual Studio, cr for vs, InterpolationMode, GDIPlus, OLE Object quality , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio