Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Exporting grouped grids

    Hello,

    i have long had grouped grids that can be exported. In order for the field that is grouped on to be included in the export, i have to manually set the fields that i want to export.
    This is pretty cumbersome (lots of array definitions, having to set them in dsrequestproperties everywhere etc.)

    One great improvement would be to just have a "includeGroupedFieldsWhenExporting" or something on the listgrid. Is this something you've considered?

    #2
    Hi mathias,

    I had/ have the same problem (unsolved so far) and would also consider this a great enhancement. This was my old thread in the forum.

    Best regards
    Blama

    Comment


      #3
      Yeah, the reason i'm looking into this now is that client wants to be able to hide fields in the grid, and then that they are omitted from export.

      That i have to iterate through them manually (as we discussed in the other thread you just answered too :) ) *combined* with this work with grouped grids, makes the code filled with boilerplate, hard to read and cumbersome code - i have lots of exportable grids, with different fields in them.

      Comment


        #4
        Not quite following what's cumbersome here: seems like you would have just one simple method, which iterates through the fields and returns all the visible ones plus the grouped fields? And this same code would work with any grid.

        But you seem to be implying that you keep repeating such code for different grids.. how is that required?

        Comment


          #5
          Well, if you want to export all fields in listgrid, i.e. you don't need to set exportFields, you still have to go through the list on export, or have a ready string array, so that also the grouped field is included. In my case, i prerendered an array for every report (approx 20), so that i did not have to iterate through the listgrid and create the field array every time the user exported.

          If there was a "includegroupingfield" that would be the only call i had to make regarding export fields when all fields are to be included.

          Comment


            #6
            Well, hopefully you didn't pre-generate string arrays for this purpose, as the iteration to produce a string array takes negligible time.

            So again it seems like forming the array of visible fields and adding in the group fields takes just a handful of lines of code, has negligible execution time, and the same code works for any grid - is anything inaccurate here?

            Comment

            Working...
            X