1
我在我的asp.net项目中使用smartxls与c#。我有以下代码:使用smartxls dll我无法更改打开的默认名称
var excel = new SmartXLS.WorkBook();
string projPath = AppDomain.CurrentDomain.BaseDirectory;
excel.readXLSX(projPath + @"ExcelTemplates\" + template);
excel.ImportDataTable(....)
Response.ContentType = "application/vnd.ms-excel";
excel.write(Context.REsponse.OutputStream);
这似乎做工精细,我的数据是在我的aspx页面上的网页连结开辟了直接,但一旦打开,它会自动命名文件default.xls,我无法弄清楚如何改变这个名字。我尝试了excel.setSheetName以及excel.DefinedName,但是它在打开时都不会更改该excel表的名称,它始终是default.xls。 有谁知道如何设置这个名字与我的代码上面? 我知道我可以重命名,如果我直接将其保存到像C:\ filename这样的路径写入,但我需要它具有特定的名称并在按钮或链接单击时自动打开客户端。
谢谢
正是我所需要的,tx – edosoft 2010-12-13 10:11:22