Home Forums WinForms controls Xceed Grid for WinForms Grid.Reporting.GenerateReportForm

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17149 |

    How do I prevent invisible columns in my grid from showing up in the column settings pane of the generate report window?

    Grid1.Columns(“Index”).ReportStyle.Visible = False

    Grid1.DataRowTemplate.Cells(“Index”).ReportStyle.Visible = False

    Neither of these two lines of code work (as I had hoped).

    Nick

    Imported from legacy forums. Posted by Nick (had 3621 views)

    User (Old forums)
    Member
    Post count: 23064

    bump

    Imported from legacy forums. Posted by Nick (had 2241 views)

    User (Old forums)
    Member
    Post count: 23064

    I really need a answer for this.  Does anyone know?

    Imported from legacy forums. Posted by Nick (had 2364 views)

    User (Old forums)
    Member
    Post count: 23064

    I need the columns listed for the user to choose from to be the same as the columns shown in the grid.  We can’t have controls columns appearing in the list on the left for the user to choose from for the report on the right.  How do I hide columns in this pane?  I need an answer asap, I’ve been waiting for an answer for a month now.

    Imported from legacy forums. Posted by Nick (had 2303 views)

    User (Old forums)
    Member
    Post count: 23064

    Unfortenately, this task is not as straight forward as it may look.  You will need to launch the Grid for .NET documentation, normally located here:

    Start -> Programs -> Xceed Components -> .NET Components -> Windows Forms -> Xceed Grid for .NET 3.8 -> Documentation

    It this documentation, go to Task-Based Help, expand, go to Reporting, expand, read about “How to use GenerateReportForm (end-user form)” and “How to use CustomizeReportStyleForm (end-user form)”.

    If I’m right (and I think I am), everything you need to know is contained in these two topics, i.e. how to redefine the ReportForm to your own needs.

     

    Imported from legacy forums. Posted by Ghislain (had 219 views)

    User (Old forums)
    Member
    Post count: 23064

    According to documentation, one of these two lines of code “should” work, but does not.  How do I hide the columns the user can add/remove from the generate report window?

    Grid1.Columns(“Index”).ReportStyle.Visible = False

    Grid1.DataRowTemplate.Cells(“Index”).ReportStyle.Visible = False

     

    Imported from legacy forums. Posted by Nick (had 422 views)

    User (Old forums)
    Member
    Post count: 23064

    What documentation are you refering to?

    Imported from legacy forums. Posted by Ghislain (had 195 views)

    User (Old forums)
    Member
    Post count: 23064

    the documentation from Xceed that defines what ReportStyle does………..

    please give explicit examples of how to solve my issue. I believe this to be a bug on Xceed’s end.

    Imported from legacy forums. Posted by Nick (had 424 views)

    User (Old forums)
    Member
    Post count: 23064

    If you take the Reporting sample application, in the Grid for .NET samples folder, and you modify the line 291 to, for example :

    this.gridControl1.Columns[“Discontinued”].ReportStyle.Visible = false;

    just before the

    using( GenerateReportForm generateReportForm = new GenerateReportForm( this.gridControl1, StylesFolder ) )

    {

    generateReportForm.ShowDialog(

    this );

    }

    is called, you will see that the checkbox for this column will be unchecked, so it is working fine.  The “Discontinued” column won’t appear on the report. 

    “Visible” in “this.gridControl1.Columns[“Discontinued”

    ].ReportStyle.Visible = false;” refers to the column being Visible on the printed report, not on the GenerateReportForm.  If you want to REMOVE this column from the the report panel, this is another story and you have to follow the steps as described in my previous message. 

    Imported from legacy forums. Posted by Ghislain (had 2112 views)

    User (Old forums)
    Member
    Post count: 23064

    [quote user=”Ghislain”]

    Unfortenately, this task is not as straight forward as it may look.  You will need to launch the Grid for .NET documentation, normally located here:

    Start -> Programs -> Xceed Components -> .NET Components -> Windows Forms -> Xceed Grid for .NET 3.8 -> Documentation

    It this documentation, go to Task-Based Help, expand, go to Reporting, expand, read about “How to use GenerateReportForm (end-user form)” and “How to use CustomizeReportStyleForm (end-user form)”.

    If I’m right (and I think I am), everything you need to know is contained in these two topics, i.e. how to redefine the ReportForm to your own needs.

     

    [/quote]

     

    This is not a solution to my problem.  I do not need to modify or add to the Report Styles listed in the generate report form.  I need to modify the Column Settings on the generate report form.  The documentation you pointed me to is for the report styles.  Please read my thread thoroughly before trying to answer my question.  Thanks.

    Imported from legacy forums. Posted by Nick (had 1990 views)

    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)

    User (Old forums)
    Member
    Post count: 23064

    That solution worked.  In addition importing that namespace in the top of your form, you need to call the customized report form using the following code:

    Dim reportForm As New Xceed.Grid.Reporting.CustomForms.GenerateReportForm(YourGrid)
    reportForm.ShowDialog()

     

    Xceed, please be advised that your documentation and samples are not as straight forward as you think they are.  There are holes and incomplete information that prevented me from accomplished this myself.  I suggest adding to your documentation all the info you supplied to me as well as my additions above.  This will make future users of your product much more appreciative.

     

     

    Imported from legacy forums. Posted by Nick (had 495 views)

    User (Old forums)
    Member
    Post count: 23064

    Keep in mind that when you post a message on a forum, if you have a vanguard subscription, you should send an priority@xceed.com at the same with a reference to this thread.  We have no mean of knowing who is vanguard on the forums and who is not. 

    Even if I know that you are vanguard, the notification for the forums can only processed once that all our priority emails have been answered.  (Actually, we are “cheating”, so to speak, because the “priority” mailbox is never empty; new cases are continuously filling it.)

    It can be a good thing to have useful information posted publicly for everyone to see but when you have vanguard and are in a hurry, you should first contact us at priority@xceed.com

    Thank you

    Imported from legacy forums. Posted by Ghislain (had 2861 views)

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.