Export to xlsx file

Hi,

We have a requirement to export database data to the excel (.xlsx) file.
The first column in excel is in "freeze" mode and contains field names. Each row of the db data should go as a column in the excel.
Is there any smart service available to achieve this ?

Attached is the sample file.

Thanks.

OriginalPostID-253002


dummy.xlsx

  Discussion posts and replies are publicly visible

Parents
  • Hi Ravinder, You can try dynamic pivot tables in SQL for this if number of columns is going to be a small. Please check the link below. However this is not advisable for a growing transaction table because as number grows the query will take long time and it may eventually cause smart service to time out. This one is ideal for lookups.
    stackoverflow.com/.../mysql-pivot-row-into-dynamic-number-of-columns

    If Number of columns is Big, than it is better to write data into an hidden sheet in excel and use Excel formulas to transponse data into sheets where you want to show it. This approach takes less time to implement and is scalable upto a good extent. Using smart services like SQL to CSV or Excel plugins we can write data into hidden sheets.

    Please let me know if you need any help further.
Reply
  • Hi Ravinder, You can try dynamic pivot tables in SQL for this if number of columns is going to be a small. Please check the link below. However this is not advisable for a growing transaction table because as number grows the query will take long time and it may eventually cause smart service to time out. This one is ideal for lookups.
    stackoverflow.com/.../mysql-pivot-row-into-dynamic-number-of-columns

    If Number of columns is Big, than it is better to write data into an hidden sheet in excel and use Excel formulas to transponse data into sheets where you want to show it. This approach takes less time to implement and is scalable upto a good extent. Using smart services like SQL to CSV or Excel plugins we can write data into hidden sheets.

    Please let me know if you need any help further.
Children
No Data