Export to Excel with grouping

DosihrisDosihris Member Posts: 23
Hi,

i want to export some data, grouped by the month and the year. I have a date field in the export data. i have one dataset every day. i want to use the excel buffer. can anybody tell me, what would be the best way to export grouped data? Should i do that manually in the code or is there a way to use the grouping functionality of the report itself??

Comments

  • matttraxmatttrax Member Posts: 2,309
    You can use the Grouping functionality of the report. In your GroupHeader or GroupFooter section, stick your code to export a line to Excel. Just send whatever variables you would have otherwise displayed.
  • DosihrisDosihris Member Posts: 23
    ah, thank you. good to know. can you shortly explain, how to group a date field? I have a date and i want to group my data in month and year.
  • KarenhKarenh Member Posts: 209
    You would need to add a field for year month, and add a key on that field. You would also need to populate the near Year Month field.

    If this is a large table, it is probably better to add Year Month field to a Buffer table because of the performance hit of a key used only for one report. You would then need to populate the Buffer table prior to running the report.

    If you filter the object designer tables on *Buffer* you will see some existing tables. Use the one with the data structure closest to what you need. Or create a new custom table.

    The Buffer table would then be the table used by the report.
  • matttraxmatttrax Member Posts: 2,309
    You could also use a Date data item on the report and do some semi-creative filtering.
Sign In or Register to comment.