Home Forums WinForms controls Xceed Grid for WinForms Grid.Reporting.GenerateReportForm Reply To: Grid.Reporting.GenerateReportForm

Xceed Support
Member
Post count: 5658

Hi Nick,

The default behaviour of setting the Visible property to False, using the GenerateReportForm class, of a GridControl Column’s ReportStyle is not to display and not to print it. All the columns will still be shown in the column settings pane, albeit unchecked.

 

To completely remove the column, whose ReportStyle’s visibility has been set to False, from the column settings pane requires the modification of the already provided GenerateReportForm class.

 

The project containing that class is available in the directory: C:\Program Files\Xceed Components\Xceed Grid for .NET 3.8\Custom forms\.

 

Specifically, you should modify the static method ShouldAddColumnToProxy to the following:

 

private static bool ShouldAddColumnToProxy( Column column )

      {

        bool shouldAdd = false;

 

        if( (!typeof( IList ).IsAssignableFrom( column.DataType ) ||

            typeof( byte[] ).IsAssignableFrom( column.DataType )) && column.ReportStyle.Visible ==true )

        {

          shouldAdd = true;

        }

 

        return shouldAdd;

      }

 

Find attached an already compiled assembly extension that you can just add to your project.

To use it, you should specifiy the namespace

 Xceed.Grid.Reporting.CustomForms.GenerateReportForm.

 

Imported from legacy forums. Posted by Mohamed [Xceed] (had 335 views)