Export to excel with dynamic columns on grid.

Certified Associate Developer

Hi,

I've one scenario where i need to display data as per the filter selection, and in filter i have a date range field where user can selection up to 2 years range and data would be displayed on grid as per the filter selection.

please suggest best way to do display data on grid and to export data on excel.

I am using record type, and i have a date column at backend.

  Discussion posts and replies are publicly visible

Parents
  • You cannot dynamically control the number of columns in a CDT or Record. In your case,

    Since it for 2 year range, try having 24 columns in CDT or Record for dynamic month display.

    In the grid you will be able to conditionally handle the header to show the dynamic month label "Jan-24"

    If there is no data for some months, hide those columns using the showwhen condition

    Using the export excel functionality 

    NOTE: This will work only for one reference number. If we try to achieve for multiple, it may introduce complexity and inconsistencies.

Reply
  • You cannot dynamically control the number of columns in a CDT or Record. In your case,

    Since it for 2 year range, try having 24 columns in CDT or Record for dynamic month display.

    In the grid you will be able to conditionally handle the header to show the dynamic month label "Jan-24"

    If there is no data for some months, hide those columns using the showwhen condition

    Using the export excel functionality 

    NOTE: This will work only for one reference number. If we try to achieve for multiple, it may introduce complexity and inconsistencies.

Children
No Data