I am attempting to take info from a lookup table then add that info to an excel spreadsheet. I am succesfully passing all the data from the table but I am unable to pass the headers/fields that are in the lookup table. I am aware that I can easily set the value of the cells to the names of the headers but I would like to make this project as dynamic as possible.
The ImportData method of the Excel connector contains a parameter for creating the headers. If you set that to true, it will use the headers from the DataTable you pass in. The LookupTable has a GetTable method that will return its underlying DataTable object. You can pass that to the ImportData method of the Excel Connector. Here is a sample solution that creates a file in C:\Temp (change that value if you cannot write there).