hi,
I have an issue when creating multiple excel files. The problem is that every single file who is opened, opens is the same instance of excel (i.e. opened 3 excel files, 1 excel.exe in task manager). its unhandy when working with multiple generated reports.
I tried to create diferent workbooks,that didnt helped, and also noticed that file size sums up, and last generated file size is the biggest, independently on the content of file. It seems that some information remains the same for all generated files(did i forgot something important to clean?).
So is there any way to create separate multiple excel files?
here is my example:
var wb = new XLWorkbook();
var wb2 = new XLWorkbook();
string select = "select * from table";
//firstfile
sheetName = "name1";
sheetName2 = "name2";
DataTable dataTable = DB.selectfromDBSA(select, sheetName);
wb.AddWorksheet(dataTable);
dataTable = DB.selectfromDBSA(select, sheetName2);
wb.AddWorksheet(dataTable);
wb.SaveAs("temp/test.xlsx");
dataTable.Clear();
wb.Worksheets.Delete(sheetName);
wb.Worksheets.Delete(sheetName2);
//for example this file weight is 175kb
//second file
sheetName = "name1";
sheetName2 = "name2";
DataTable dataTable = DB.selectfromDBSA(select, sheetName);
wb2.AddWorksheet(dataTable);
dataTable = DB.selectfromDBSA(select, sheetName2);
wb2.AddWorksheet(dataTable);
wb2.SaveAs("temp/test2.xlsx");
dataTable.Clear();
wb2.Worksheets.Delete(sheetName);
wb2.Worksheets.Delete(sheetName2);
//for example this file weight is 285kb, but information is the same, because its same query to database.
thanks,
Comments: yes, when I open generated files in windows explorer, for example two files, in task manager I see one process called "excel.exe", and I can't split them in the different corners of the monitor, to see one excel in foreground and another in background. They act like they would be as one file or opened on one instance or something(did you tried to open attached files?). If I move one, and another moves to same place.. I don't know how else to explain... but if I open new empty excel document(not generated with closedxml), I can split them like the way I want, for example, one in the left side, and other on the right side of the monitor, then I can analyze the data simultaneously. thanks.
I have an issue when creating multiple excel files. The problem is that every single file who is opened, opens is the same instance of excel (i.e. opened 3 excel files, 1 excel.exe in task manager). its unhandy when working with multiple generated reports.
I tried to create diferent workbooks,that didnt helped, and also noticed that file size sums up, and last generated file size is the biggest, independently on the content of file. It seems that some information remains the same for all generated files(did i forgot something important to clean?).
So is there any way to create separate multiple excel files?
here is my example:
var wb = new XLWorkbook();
var wb2 = new XLWorkbook();
string select = "select * from table";
//firstfile
sheetName = "name1";
sheetName2 = "name2";
DataTable dataTable = DB.selectfromDBSA(select, sheetName);
wb.AddWorksheet(dataTable);
dataTable = DB.selectfromDBSA(select, sheetName2);
wb.AddWorksheet(dataTable);
wb.SaveAs("temp/test.xlsx");
dataTable.Clear();
wb.Worksheets.Delete(sheetName);
wb.Worksheets.Delete(sheetName2);
//for example this file weight is 175kb
//second file
sheetName = "name1";
sheetName2 = "name2";
DataTable dataTable = DB.selectfromDBSA(select, sheetName);
wb2.AddWorksheet(dataTable);
dataTable = DB.selectfromDBSA(select, sheetName2);
wb2.AddWorksheet(dataTable);
wb2.SaveAs("temp/test2.xlsx");
dataTable.Clear();
wb2.Worksheets.Delete(sheetName);
wb2.Worksheets.Delete(sheetName2);
//for example this file weight is 285kb, but information is the same, because its same query to database.
thanks,
Comments: yes, when I open generated files in windows explorer, for example two files, in task manager I see one process called "excel.exe", and I can't split them in the different corners of the monitor, to see one excel in foreground and another in background. They act like they would be as one file or opened on one instance or something(did you tried to open attached files?). If I move one, and another moves to same place.. I don't know how else to explain... but if I open new empty excel document(not generated with closedxml), I can split them like the way I want, for example, one in the left side, and other on the right side of the monitor, then I can analyze the data simultaneously. thanks.