tab 1
此 demo 展示如何使用 marker designer,基于模板导出 excel。
如果这不是您想要的 demo,您可以通过填写表格获取免费定制 demo。
如您有与我们产品相关的其他技术问题,请联系 该email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用javascript。;销售相关的问题,请联系 该email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用javascript。。
tab 2
using system.data;
using spire.xls;
namespace demoonlinecode
{
class markerdesigner
{
public void demomarkerdesigner(string filepath,string datafilepath,string resultfilepath)
{
workbook data_book = new workbook();
data_book.loadfromfile(datafilepath);
datatable table = data_book.worksheets[0].exportdatatable();
workbook workbook = new workbook();
workbook.loadfromfile(filepath);
worksheet sheet = workbook.worksheets[0];
worksheet sheet2 = workbook.worksheets[1];
sheet.name = "result";
sheet2.name = "datasource";
sheet2.insertdatatable(table, true, 1, 1);
workbook.markerdesigner.addparameter("variable1", 1234.5678);
workbook.markerdesigner.adddatatable("country", table);
workbook.markerdesigner.apply();
sheet.allocatedrange.autofitrows();
sheet.allocatedrange.autofitcolumns();
workbook.savetofile(resultfilepath, excelversion.version2010);
}
}
}
tab 3
imports system.data
imports spire.xls
namespace demoonlinecode
class markerdesigner
public sub demomarkerdesigner(filepath as string, datafilepath as string, resultfilepath as string)
dim data_book as new workbook()
data_book.loadfromfile(datafilepath)
dim table as datatable = data_book.worksheets(0).exportdatatable()
dim workbook as new workbook()
workbook.loadfromfile(filepath)
dim sheet as worksheet = workbook.worksheets(0)
dim sheet2 as worksheet = workbook.worksheets(1)
sheet.name = "result"
sheet2.name = "datasource"
sheet2.insertdatatable(table, true, 1, 1)
workbook.markerdesigner.addparameter("variable1", 1234.5678)
workbook.markerdesigner.adddatatable("country", table)
workbook.markerdesigner.apply()
sheet.allocatedrange.autofitrows()
sheet.allocatedrange.autofitcolumns()
workbook.savetofile(resultfilepath, excelversion.version2010)
end sub
end class
end namespace