Message-ID: <559338032.8913.1711668012101.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8912_1496257086.1711668012101" ------=_Part_8912_1496257086.1711668012101 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Template Grouping and Nesting

Template Grouping and Nesting

Intro

Data markers = have multiple switches and options that are available for use in ExcelTempl= ate workbooks.

ExcelTemplate Grouping and Nesting allows users to bind flat data to a s= pecially formatted spreadsheet with the data being displayed in a grouped o= r nested format. To learn how to create a template for Grouping and Nesting= , see our in-depth tutorai Using Grouping and Nesting with ExcelTemplate.<= /p>=20

= =20

Requirements

=20
=20

This sample requires OfficeWriter Enterprise Edition to be installed bec= ause the OfficeWriter Grouping and Nesting is only available in the Enterpr= ise Edition of the product.

=20
=20
=20

Code

=20
public class GroupingAndNesting
    {
        /// <summary>
        /// Build the report with ExcelTemplate
        /// </summary>
        public void GenerateReport()
        {
            //--- Create a new ExcelTemplate object and open a template fil=
e

            ExcelTemplate xlt =3D new ExcelTemplate();
            //Open the template
            xlt.Open(@"..\..\ExcelTemplateFiles\GroupingAndNestingTemp=
late.xlsx");

            //--- Fill the dataset with the data from the CSV file
            DataSet ds =3D GetCSVData(@"..\..\ExcelData\GroupingandNes=
tingData.CSV");


            //--- Bind the data to the template file and save it.
            xlt.BindData(ds, "Data", xlt.CreateDataBindingPropert=
ies());
            xlt.Process();
            xlt.Save(@"..\..\ExcelOutputFiles\GroupingandNesting_outpu=
t.xlsx");
        }

        //Parse the data from the CSV file
        System.Data.DataSet GetCSVData(string csvFileName)
        {
            DataSet ds;
            using (GenericParserAdapter parser =3D new GenericParserAdapter=
(csvFileName))
            {
                parser.ColumnDelimiter =3D ',';
                parser.FirstRowHasHeader =3D true;

                ds =3D parser.GetDataSet();
            }
            return ds;
        }
    }


=20

 

Downloads

------=_Part_8912_1496257086.1711668012101--