SAP Knowledge Base Article - Public

1913575 - How to delete a group field from a Crystal report at runtime?


How to delete a group field from a Crystal report at runtime?


  • Crystal Reports 2008 / SAP Crystal Reports, Developer version for Microsoft Visual Studio.
  • Visual Studio 2008 / Visual Studio 2010


Here is C# sample code developed using Crystal Reports InProc RAS .NET SDK to delete a group from a report.

CrystalDecisions.CrystalReports.Engine.ReportDocument rd = new CrystalDecisions.CrystalReports.Engine.ReportDocument();


ISCDReportClientDocument boReportClientDocument;

boReportClientDocument = rd.ReportClientDocument;
int groupCount = boReportClientDocument.DataDefinition.Groups.Count;

if (groupCount > 0)


for (int i = 0; i < groupCount; i++)


CrystalDecisions.ReportAppServer.DataDefModel.Group group = boReportClientDocument.DataDefinition.Groups[i];
// Remove the group


CrystalReportViewer1.ReportSource = rd;




bi, sap, beginner, business_intelligence_(businessobjects), sap_crystal_reports, visual, for, .net, crforvs, crvs2010, studio, sdk, crystal_reports,, cr, formula, crystal_reports_for_visual_studio_2010,, business_intelligence_(business, crystal_reports_2008, groupfield, group expert, crystal_report, code_resuability, crvs, cr2008,, cr4vs2010, vs2012, Visual studio 2012, .net 4, crfor .net , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To


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