SAP Knowledge Base Article - Public

1283550 - How to suppress a Crystal Report area at runtime dynamically using inproc RAS for .NET


How to suppress a Crystal Report area at runtime dynamically using inproc RAS for .NET


To suppress a Crystal Report area use the code below:

        ReportDocument m_boReportDocument;
        ISCDReportClientDocument m_boReportClientDocument;

        CrystalDecisions.ReportAppServer.ReportDefModel.Section m_boSection;
        CrystalDecisions.ReportAppServer.ReportDefModel.ISCRArea m_boRHArea;
        CrystalDecisions.ReportAppServer.ReportDefModel.ISCRAreaFormat m_boRHAreaFormat;

         //Access the ReportClientDocument in the ReportDocument (EROM bridge)
         m_boReportClientDocument = m_boReportDocument.ReportClientDocument;

          //First determine the section - in this case the report header section
          m_boSection = m_boReportClientDocument.ReportDefController.ReportDefinition.ReportHeaderArea.Sections[0];

          //Second determine the area
         m_boRHArea = m_boReportClientDocument.ReportDefController.ReportDefinition.ReportHeaderArea;

         //Second determine the Format
         m_boRHAreaFormat = m_boRHArea.Format;

         m_boRHAreaFormat.EnableSuppress = true;

         // Use the Report Area Controller object to set the property.
         m_boReportClientDocument.ReportDefController.ReportAreaController.SetProperty(m_boRHArea, _
                             CrystalDecisions.ReportAppServer.Controllers.CrReportAreaPropertyEnum.crReportAreaPropertyFormat, m_boRHAreaFormat);   


suppress crystal report area inproc NET , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To


Crystal Reports 2008 V1 ; SAP Crystal Reports XI R2 ; SAP Crystal Reports, developer version for Microsoft Visual Studio