officewriter - Export ado.net dataset into excel worksheets using softartisans Excelwriter -


i have ado.net dataset have 3 datatables let dataset name customer , tables accounts, purchases , profile . export them using softartisans excelwriter worksheets using templates

example

 dataset mydataset = new dataset();         mydataset.tables.add("customer");         mydataset.tables.add("accounts");         mydataset.tables.add("purchases");         xlt.binddata(mydataset,null , xlt.createdatabindingproperties()); 

i export theses tables seperate excel worksheets.

the binddata method of officewriter's exceltemplate object has number of overloads. 1 accepts dataset not automatically import every datatable in dataset, imports first one. if want use every datatable in dataset, should use overload takes datatable (see documentation). example:

//the 2nd parameter datasource name must correspond first  //part of datamarker in template workbook (i.e. %%=customer.firstname) xlt.binddata(ds.tables["customer"], "customer", xlt.createdatabindingproperties()); 

you in loop, this:

foreach (datatable table in mydataset.tables)    {      xlt.binddata(table, table.tablename, xlt.createdatabindingproperties());    } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -