But here in our case we are not sure of the out put column names. Based on the parameters what we pass to the SP, the out put columns will be different.
I can smell the stored procedure from here :-) Ideally a stored procedure should have a defined output interface that does not depend on the input parameters. That is neither here nor there is you do not control the code in that stored procedure and just need to work with it as is. Just know that it is less than ideal and is something to avoid in your own new development.
So in that case how do we approach this?
How much data are we talking about? You need a way to derive the metadata so you can build your Excel Worksheets. There are likely many ways to do this but if there is not more data than you can comfortably hold in memory you could capture the results of the stored procedure into a variable of type Object, i.e. a DataSet, then inspect the DataSet in a ScriptTask to figure the columns names and data types. From that you can uset he Excel object to build your Workbook and write your data.
__________________________________________________________________________________________________There are no special teachers of virtue, because virtue is taught by the whole community. --Plato