Symptom
How to suppress a Crystal Report area at runtime dynamically using inproc RAS for .NET
Resolution
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);
Keywords
suppress crystal report area inproc NET , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To