The Report Parameters Object feature is introduced to show the custom filter dialog before previewing XafReport. But, since it can be accessed via the report's scripts (see Access Report Filter Parameters in Scripts), it is possible to customize other things, depending on the user's choice, with the help of this feature. This example demonstrates how to manage the grouping depth in XtraReport. The value, passed by the end-user via the dialog shown before the Report Preview, is used to change the visibility of group headers, used for grouping, as shown in the following code:
See Also:[C#]usingDevExpress.ExpressApp.Reports;usingWinSample.Module;privatevoidOnBeforePrint(objectsender,System.Drawing.Printing.PrintEventArgse){MyReportParametersObjectreportParametersObject=((XafReport)xafReport1).ReportParametersObjectasMyReportParametersObject;if(reportParametersObject!=null){switch(reportParametersObject.GroupDepth){case 0:GroupHeader1.Visible=false;gotocase 1;case 1:GroupHeader2.Visible=false;gotocase 2;case 2:GroupHeader3.Visible=false;gotocase 3;case 3:GroupHeader4.Visible=false;gotocase 4;case 4:GroupHeader5.Visible=false;break;}}}
Scripting Overview
How to use custom ReportParametersObject to filter detail reports ( DetailReportBand )