API
Version 7.x > API > Exporting Custom Table data programmatically in Excel format View modes: 
User avatar
Member
Member
emccall-dataspringinc - 3/22/2013 10:17:12 AM
   
Exporting Custom Table data programmatically in Excel format
I have a custom table that I would like to export in Excel format (.XLSX) to be able to run reports on the data. (This is for a client, of course.) How can I hook into existing export functionality through the code? The exact functionality I need already exists - it's the same thing as selecting 'Export to Excel' from the Actions drop-down in the header of the custom table data view.

The reason why I need to be able to do this programmatically is because I am actually creating a scheduled task which will export the data (in Excel format as described above), and then truncate the table (i.e. delete all data but leave the table structure as it is). So simply put: periodically dump the data (so the table doesn't bloat to a crazy size) but retain the data in Excel format for reporting purposes.

Any help will be greatly appreciated!

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 3/22/2013 9:07:14 PM
   
RE:Exporting Custom Table data programmatically in Excel format
My first thought is Excel has row limitations so maybe you have to define what table "bloating" is. A table with a million records isn't a problem. Maybe export the custom table data to another table for reporting purposes. If you take a look at this post, it looks like there is a code sample there for you that should get you going in the right direction.