In reference at the post: http://www.aspose.com/community/Forums/10710/ShowPost.aspx
I would like to do the same thing with my web application. Having a template and then build dynamically a number of worksheet (the number of worksheet can change form one user to another) based on one unique template.
Here is my code:
DataSet ds = CreateDataSource(1);
ExcelDesigner designer = new ExcelDesigner();
designer.Excel.Worksheets.AddCopy(0);// if I add this line, it will copy the data of the worksheet into the worksheet. I have then 2 identical worksheet while I would like to have 2 different worksheet from 2 diferent datasource
designer.Save("result.xls", SaveType.OpenInExcel, FileFormatType.Default, this.Response);
if I do not add this line :designer.Excel.Worksheets.AddCopy(0); , I am getting the following error.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Thanks for your help