Skip to Content
0
Mar 17, 2021 at 02:49 PM

Order the columns of an output Excel file

50 Views

Hi guys,

I have a problem with the creation of an excel file.

There is a database table where information about materials is stored (material number, description, price, weight, etc.).
I want to export a part of this table based on a customizing table.
In this customizing table I can mark the fields that shall be selected from the materials table and the order of the fields in excel file that shall be created.

For example, I mark material number, price and weight and set the order for the output file as 1.material number 2.weight 3.price.
Now I want to select the marked fields from the material table and create an output excel to export the data in the correct order.

I have no idea how to code this. Should this be done with a dynamic select statement?
Because the fields that shall be selected fields can vary from time to time.
And if I select all the material data, I dont know ho to get the wanted data from the result based on the customizing?

Could you help me please?
Thanks and best regards.

Chris