xlsgen > overview > Export

xlsgen has flexible import and export facilities. You can :

 

 

Export

Export includes the ability to save the content as a .NET dataset, CSV (semi-colon separated values), as HTML (web), as XML (angle brackets, fixed schema), as OpenOffice and as PDF.

 

Export a .NET dataset

If you are programming the xlsgen object model with a .NET programming language, chances are you are also dealing with .NET datasets (the System.Data.DataSet class). xlsgen provides no direct .NET support through the object model since it would make it .NET-dependent, but there is one code sample (called dataset_creation, in VB.NET and C#) as part of the install which explains how to export a general purpose .NET dataset. The code sample shows how to preserve the worksheet data types in cells across the process.

The following is the C# version of the code sample :

C# code
// open a worksheet with a data source in it

CoXlsEngine engine = new CoXlsEngine();

IXlsWorkbook wbk = engine.Open("Book1_datasource.xls", "");

IXlsWorksheet wksht = wbk.get_WorksheetByIndex(1);


// grab the data source boundaries

int rowmin = wksht.Dimensions.FirstRow;
int rowmax = wksht.Dimensions.LastRow;
int colmin = wksht.Dimensions.FirstColumn;
int colmax = wksht.Dimensions.LastColumn;


// create a generic dataset

DataTable workTable = new DataTable("data source");


// create columns

for (int c = colmin; c <= colmax; c++)
{
    xlsgen.enumDataType dt = wksht.get_CellType(rowmin, c);
    switch (dt)
    {
        case enumDataType.datatype_notapplicable:
        case enumDataType.datatype_string:
            {
                workTable.Columns.Add(null, typeof(String));
            }break;
        case enumDataType.datatype_time:
        case enumDataType.datatype_date:
        case enumDataType.datatype_datetime:
            {
                workTable.Columns.Add(null, typeof(DateTime));
            }break;
        case enumDataType.datatype_number:
        case enumDataType.datatype_boolean:
        case enumDataType.datatype_error:
            {
                workTable.Columns.Add(null, typeof(int));
            }break;
        case enumDataType.datatype_float:
        case enumDataType.datatype_double:
            {
                workTable.Columns.Add(null, typeof(double));
            }break;
        default: break;
    }
}


// fetch the data

for (int r = rowmin; r <= rowmax; r++)
{
    DataRow dr = workTable.NewRow();

    for (int c = colmin; c <= colmax; c++)
    {
        xlsgen.enumDataType dt = wksht.get_CellType(rowmin, c);

        DataColumn dc = workTable.Columns[c - colmin];

        switch (dt)
        {
            case enumDataType.datatype_notapplicable:
            case enumDataType.datatype_string:
                {
                    dr[dc] = wksht.get_Label(r, c);
                } break;
            case enumDataType.datatype_time:
            case enumDataType.datatype_date:
            case enumDataType.datatype_datetime:
                {
                    dr[dc] = DateTime.FromOADate(wksht.get_Float(r, c));
                } break;
            case enumDataType.datatype_number:
            case enumDataType.datatype_boolean:
            case enumDataType.datatype_error:
                {
                    dr[dc] = wksht.get_Number(r, c);
                } break;
            case enumDataType.datatype_float:
            case enumDataType.datatype_double:
                {
                    dr[dc] = wksht.get_Float(r, c);
                } break;
            default: break;
        }
    }

    workTable.Rows.Add(dr);
}


wbk.Close();


// write the data table's contents in XML

workTable.WriteXml("Book1_datasource.xml");

 

Export as CSV

CSV is a semi-colon separated file format. CSV actually stands for comma-separated values, but for many years in the software industry commas have proven to be problematic to disambiguate floating point separators, locales and content. The worksheet is a grid whose content is exported as CSV where each row of the grid is expressed as semi-colon separated fields, ending with a carriage return character. Whenever the content contains a semi-colon, the content is surrounded by double quotes. Double quotes in content are themselves doubled. By definition, a CSV file does not define the dimensions of the worksheet. It's raw content. That said, the width and height can be computed by reading the file and incrementing an appropriate counter.

Optionally, exporting to CSV renders numbers according to their associated number formats. By default, raw numbers are exported as such. For instance 8.506 with an associated 0.00 number format will be exported as 8.506. When the number formatting option is set, see the options interface, 8.506 is exported as 8.51, assuming the user's regional settings for decimal separators is the dot character (i.e. 8,51 if the user's regional settings for decimal separators is the comma character).

Exporting the content of a worksheet as CSV is analogous to XML.See the IXlsWorksheetExport interface. The difference is that the developer can choose the encoding between UTF-8 and the current local charset.

Here is an example CSV file :

ID;DESCRIPTION;DATE;PRICE
45;description1;10/06/2006;10,2
12;description2;11/06/2006;5,25
32;description3;12/06/2006;6,3
86;description4;13/06/2006;9,99
74;description5;14/06/2006;4,45
29;description6;15/06/2006;8,5
31;description7;16/06/2006;7
56;description8;17/06/2006;11,5
52;description9;18/06/2006;11

And here is how to export a worksheet as CSV with code :

VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.Open("C:\input\MyExistingFile.xls", "C:\output\ResultingFile.xls")

' get the second worksheet
Dim wksht002 As IXlsWorksheet
Set wksht002 = wbk.WorksheetByIndex(2)

' export the worksheet as csv (export the content, UTF-8 encoding)
wksht002.Export.ExportAsCSV("filename.csv", True)

wbk.Close

Set engine = Nothing

C# code
xlsgen.CoXlsEngine excel = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = excel.Open( @"C:\input\MyExistingFile.xls", "" );

// get the second worksheet
IXlsWorksheet wksht002 = wbk.get_WorksheetByIndex(2);

// export the worksheet as csv (export the content, UTF-8 encoding)
wksht002.Export.ExportAsCSV("filename.csv", 1 /*use UTF8 encoding*/);

wbk.Close();
excel = null;

C/C++ code
{
  xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

  xlsgen::IXlsWorkbookPtr wbk;
  wbk = engine->Open(L"C:\\input\\MyExistingFile.xls", L"" );

  // get the second worksheet
  xlsgen::IXlsWorksheetPtr wksht002 = wbk->WorksheetByIndex[2];

  // export the worksheet as csv (export the content, UTF-8 encoding)
  wksht002->Export->ExportAsCSV(L"filename.csv", TRUE /*use UTF8 encoding*/);

  wbk->Close();
}

 

Export as XML

The XML export provides a cross-platform way to save content. XML content follows a schema. The schema used cannot be controlled by the developer, although this could happen in the future based on demand. The schema is conside and self-descriptive to maximize the usefulness of using XML in the first place. The encoding defaults to UTF-8 which means strings are encoded in ways understandable in any country of the world.

The XML output is made of a header followed by the content of the worksheet. The content of the worksheet is a collection of rows. Each rows contains a collection of columns. Each column contains the content of a cell. At this point, the developer can optionally choose to add what is known as data types. Data types are quite verbose but provide a great way to know which data type identifies a given cell, for instance a time type. After all, the more typed the content is, the more accurate are operations made on them. Here is an example of XML content :

<?xml version="1.0"?>
<WORKSHEET NAME="Feuil1">
<DIMENSIONS>
 <ROWMIN>4</ROWMIN>
 <ROWMAX>4</ROWMAX>
 <COLMIN>3</COLMIN>
 <COLMAX>5</COLMAX>
</DIMENSIONS>
<ROWS>
  <R>
    <C T="number">2</C>
    <C T="number">3</C>
    <C T="number">4</C>
  </R>
 </ROWS>
</WORKSHEET>

Producing the XML for a given worksheet is achieved by requesting the Export object from the worksheet (see the IXlsWorksheetExport interface), and then call the exporter of your choice with appropriate parameters.

VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.Open("C:\input\MyExistingFile.xls", "C:\output\ResultingFile.xls")

' get the second worksheet
Dim wksht002 As IXlsWorksheet
Set wksht002 = wbk.WorksheetByIndex(2)

' export the worksheet as xml (export the content and data types)
wksht002.Export.ExportAsXML("filename.xml", True)

wbk.Close

Set engine = Nothing

C# code
xlsgen.CoXlsEngine excel = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = excel.Open( @"C:\input\MyExistingFile.xls", "" );

// get the second worksheet
IXlsWorksheet wksht002 = wbk.get_WorksheetByIndex(2);

// export the worksheet as xml (export the content and data types)
wksht002.Export.ExportAsXML("filename.xml", 1 /*datatype*/);

wbk.Close();
excel = null;

C/C++ code
{
  xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

  xlsgen::IXlsWorkbookPtr wbk;
  wbk = engine->Open(L"C:\\input\\MyExistingFile.xls", L"" );

  // get the second worksheet
  xlsgen::IXlsWorksheetPtr wksht002 = wbk->WorksheetByIndex[2];

  // export the worksheet as xml (export the content and data types)
  wksht002->Export->ExportAsXML(L"filename.xml", TRUE /*datatype*/);

  wbk->Close();
}

In the content, some characters are replaced with XML entities. These are :

 

 

Export as PDF

The PDF file format makes xlsgen even more suitable for reporting purposes. Very often, Adobe's PDF documents are the best choice to ensure 1) same rendering on any operating system 2) read-only document 3) compact size.


A PDF document generated by xlsgen

The PDF file output supported natively by xlsgen is compatible with Adobe Acrobat Reader 5.0 and above, and other products from the Acrobat family.

How to export a worksheet as PDF is straight forward :

Java code
XlsEngine engine = new XlsEngine();

XlsWorkbook wbk = engine.Open("C:\\input\\MyExistingFile.xls", "");

// export the second worksheet as pdf
wbk.getWorksheetByIndex(2).getExport().ExportAsPDF("C:\\output\\filename.pdf");

wbk.Close();
VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.Open("C:\input\MyExistingFile.xls", "")

' export the second worksheet as pdf
wbk.WorksheetByIndex(2).Export.ExportAsPDF("C:\output\filename.pdf")

wbk.Close

Set engine = Nothing
C# code
xlsgen.CoXlsEngine engine = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = engine.Open( @"C:\input\MyExistingFile.xls", "" );

// export the second worksheet as pdf
wbk.get_WorksheetByIndex(2).Export.ExportAsPDF(@"C:\output\filename.pdf");

wbk.Close();
C/C++ code
xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->Open(L"C:\\input\\MyExistingFile.xls", L"" );

// export the second worksheet as pdf
wbk->WorksheetByIndex[2]->Export->ExportAsPDF(L"C:\\output\\filename.pdf");

wbk->Close();

Another way to create PDF files is to pass .pdf filenames directly when making a New(), Open(), NewInMemory(), OpenInMemory() call. Doing so orders xlsgen to create a PDF output file representing the entire spreadsheet (not just the current worksheet of the spreadsheet as in above). This mechanism makes xlsgen as much a genuine PDF generator than an Excel generator :

Java code
XlsEngine engine = new XlsEngine();

XlsWorkbook wbk = engine.New( "output.pdf" );

XlsWorksheet wksht = wbk.AddWorksheet("samplesheet");
wksht.setLabel(1,2, "Hello world!");

wbk.Close();
VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.New( "output.pdf" )

Dim wksht As IXlsWorksheet
Set wksht = wbk.AddWorksheet("samplesheet")

wksht.Label(1,2) = "Hello world!"

wbk.Close

Set engine = Nothing
C# code
xlsgen.CoXlsEngine engine = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = engine.New( "output.pdf" );

IXlsWorksheet wksht = wbk.AddWorksheet( "samplesheet" );
wksht.set_Label(1,2, "Hello world!");

wbk.Close();
C/C++ code
xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->New( L"output.pdf" );

xlsgen::IXlsWorksheetPtr wksht = wbk->AddWorksheet( "samplesheet" );
wksht->Label[1][2] = L"Hello world!";

wbk->Close();

PDF files generated by xlsgen include cells and their formatting (including conditional formatting applied to it), pictures, charts, visual components (geomaps, ...), text boxes and vector shapes. It also applies a number of page setup options including : the print area, scale (two-way), page breaks, margins, header/footer, repeat rows/columns and so on.

New PDF Engine


selectable text in PDF files created by xlsgen

 

xlsgen has three PDF engines to choose from :

 

PDF Encryption

A PDF file generated by xlsgen can be encrypted and therefore require a password be entered by the user trying to open the PDF file. In order to do so, the EncryptionPassword property at the workbook level can be used.

 

PDF font embedding

Over the years, the PDF engine has been ramped up to support adavanced features such as :

 

 

Export as HTML

xlsgen can generate HTML documents, much like PDF and other output formats. The HTML markup language is 4.0 which means xlsgen uses CSS stylesheets to account for the formatting in cells.


AN HTML document generated by xlsgen (notice sheet tabs at the bottom)

The HTML generation is exposed both at the worksheet level, i.e. a single worksheet is exported, or at the workbook level, i.e. all worksheets are exported. In the latter case, the HTML pages are enclosed within a frame at the bottom where all the sheet tabs are listed and made clickable.

To export as HTML, a file is passed in parameter. The HTML generation creates more than one file : for each worksheet, there is a file pair, the first file is the HTML markup, the other one is the corresponding CSS stylesheet. If you are to use the generated documents in some application of yours, make sure to copy all generated files, not only .html files.

HTML being a display format, obviously formulas are not exported and every object such as charts are static, i.e. these are bitmaps. The markup uses a convenient naming internally, so a HTML developer is able to parse the HTML markup and gather all such bitmaps, all while making differences between bitmaps representing pictures and bitmaps representing charts. Charts can be exported as PNG or SVG depending on a specific option.

The conditional formats are applied to the cells so that it reflects the real spreadsheet (i.e. internally calculated by xlsgen). Obviously none of the fancy objects such as data validation and auto-filters are exported since HTML is static in nature. That said, since xlsgen computes auto-filters, one could filter data prior exporting it to HTML, and the resulting document would reflect exactly that.

How to export a worksheet or all worksheets as HTML is straight forward :

Java code
XlsEngine engine = new XlsEngine();

XlsWorkbook wbk = engine.Open("C:\\input\\MyExistingFile.xls", "");

// 1) export the second worksheet as html
wbk.getWorksheetByIndex(2).getExport().ExportAsHTML("C:\\output\\filename.html");

wbk.Close();

// 2) open an existing spreadsheet and export it as html
XlsWorkbook wbk_ = engine.Open("C:\\input\\MyExistingFile.xls", "C:\\output\\report.html");

wbk_.Close();

VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.Open("C:\input\MyExistingFile.xls", "")

' 1) export the second worksheet as html
wbk.WorksheetByIndex(2).Export.ExportAsHTML("C:\output\filename.html")

wbk.Close

' 2) open an existing spreadsheet and export it as html
XlsWorkbook wbk_ = engine.Open("C:\input\MyExistingFile.xls", "C:\output\report.html")

wbk_.Close

Set engine = Nothing
C# code
xlsgen.CoXlsEngine engine = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = engine.Open( @"C:\input\MyExistingFile.xls", "" );

// 1) export the second worksheet as html
wbk.get_WorksheetByIndex(2).Export.ExportAsHTML(@"C:\output\filename.html");

wbk.Close();

// 2) open an existing spreadsheet and export it as html
XlsWorkbook wbk_ = engine.Open(@"C:\input\MyExistingFile.xls", @"C:\output\report.html");

wbk_.Close();
C/C++ code
xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->Open(L"C:\\input\\MyExistingFile.xls", L"" );

// 1) export the second worksheet as html
wbk->WorksheetByIndex[2]->Export->ExportAsHTML(L"C:\\output\\filename.html");

wbk->Close();

// 2) open an existing spreadsheet and export it as html
XlsWorkbook wbk_ = engine->Open(L"C:\\input\\MyExistingFile.xls", L"C:\\output\\report.html");

wbk_->Close();

 

Serving Html views

Since Html views are made of more than one file, consisting in Html markup on the one hand, on everything else on the other hand (images, CSS, ...), a mechanism must be provided for links in Html markup to route back and access these resources. That is especially the case in the html view server scenario where a web browser tries to display an Html view generated by xlsgen. When a link is made to a resource, the link must contain the fully qualified server path and parameters, otherwise secondary web browser calls will never be able to access the resources such as images, CSS, and so on. Towards that goal, xlsgen exposes a UrlPrefix option which, when used, prefixes any such link with the passed string. This mechanism enables routing links from the client application, through the server eventually to the folder where xlsgen stores the Html view resources.

As example, if the server is hosted at address 127.0.0.1, passing a url prefix such as 127.0.0.1/server/docid=xxx?img=, ensures that secondary calls have a chance to cross the server and reach the actual resources. Of course, the processing itself of such url query is left to the discretion of the server.

 

 

Export as Open Office

xlsgen can generate native Open Office spreadsheets (.ods files), including all major objects from spreadsheets :

It is important to know that all such objects are native and interactive, these are not bitmaps.

The OpenOffice generation is exposed at both the workbook level and at the worksheet level.

xlsgen can be used in a number of scenarios such as the generation of .ods files from nothing (New()), the generation of .ods files from existing .xls or .xlsx files (Open()). And also the in-memory variants. .ods files can also be read.


An OpenOffice spreadsheet generated by xlsgen

To generate OpenOffice spreadsheets is straight forward :

Java code
XlsEngine engine = new XlsEngine();

XlsWorkbook wbk = engine.Open("C:\\input\\MyExistingFile.xls", "");

// 1) export the second worksheet as Open Office
wbk.getWorksheetByIndex(2).getExport().ExportAsOpenOfficeFormat("C:\\output\\filename.ods");

wbk.Close();

// 2) open an existing spreadsheet and export it as Open Office
XlsWorkbook wbk_ = engine.Open("C:\\input\\MyExistingFile.xls", "C:\\output\\filename.ods");

wbk_.Close();

VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.Open("C:\input\MyExistingFile.xls", "")

' 1) export the second worksheet as Open Office
wbk.WorksheetByIndex(2).Export.ExportAsOpenOfficeFormat("C:\output\filename.ods")

wbk.Close

' 2) open an existing spreadsheet and export it as Open Office
XlsWorkbook wbk_ = engine.Open("C:\input\MyExistingFile.xls", "C:\output\filename.ods")

wbk_.Close

Set engine = Nothing
C# code
xlsgen.CoXlsEngine engine = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = engine.Open( @"C:\input\MyExistingFile.xls", "" );

// 1) export the second worksheet as Open Office
wbk.get_WorksheetByIndex(2).Export.ExportAsOpenOfficeFormat(@"C:\output\filename.ods");

wbk.Close();

// 2) open an existing spreadsheet and export it as Open Office
XlsWorkbook wbk_ = engine.Open(@"C:\input\MyExistingFile.xls", @"C:\output\filename.ods");

wbk_.Close();
C/C++ code
xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->Open(L"C:\\input\\MyExistingFile.xls", L"" );

// 1) export the second worksheet as Open Office
wbk->WorksheetByIndex[2]->Export->ExportAsOpenOfficeFormat(L"C:\\output\\filename.ods");

wbk->Close();

// 2) open an existing spreadsheet and export it as Open Office
XlsWorkbook wbk_ = engine->Open(L"C:\\input\\MyExistingFile.xls", L"C:\\output\\filename.ods");

wbk_->Close();

 

 

Export as XPS

The XPS file format makes xlsgen suitable for reporting purposes. The XPS file format was introduced by Microsoft to compete with PDF for fixed representations and printing. It is very compact in size. More information about XPS can be found here (users) and here (developers).


A XPS document generated by xlsgen, viewed in Internet Explorer

The XPS file output supported natively by xlsgen is compatible with Microsoft's Internet Explorer internal XPS viewer. Simply double-click on a .XPS file and it should open in Internet Explorer.

How to export a worksheet as XPS is straight forward :

Java code
XlsEngine engine = new XlsEngine();

XlsWorkbook wbk = engine.Open("C:\\input\\MyExistingFile.xls", "");

// export the second worksheet as xps
wbk.getWorksheetByIndex(2).getExport().ExportAsXPS("C:\\output\\filename.xps");

wbk.Close();
VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.Open("C:\input\MyExistingFile.xls", "")

' export the second worksheet as xps
wbk.WorksheetByIndex(2).Export.ExportAsXPS("C:\output\filename.xps")

wbk.Close

Set engine = Nothing
C# code
xlsgen.CoXlsEngine engine = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = engine.Open( @"C:\input\MyExistingFile.xls", "" );

// export the second worksheet as xps
wbk.get_WorksheetByIndex(2).Export.ExportAsXPS(@"C:\output\filename.xps");

wbk.Close();
C/C++ code
xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->Open(L"C:\\input\\MyExistingFile.xls", L"" );

// export the second worksheet as xps
wbk->WorksheetByIndex[2]->Export->ExportAsXPS(L"C:\\output\\filename.xps");

wbk->Close();

Another way to create XPS files is to pass .xps filenames directly when making a New(), Open(), NewInMemory(), OpenInMemory() call. Doing so orders xlsgen to create a XPS output file representing the entire spreadsheet (not just the current worksheet of the spreadsheet as in above). This mechanism makes xlsgen as much a genuine XPS generator than an Excel generator :

Java code
XlsEngine engine = new XlsEngine();

XlsWorkbook wbk = engine.New( "output.xps" );

XlsWorksheet wksht = wbk.AddWorksheet("samplesheet");
wksht.setLabel(1,2, "Hello world!");

wbk.Close();
VB code
Dim engine As CoXlsEngine
Set engine = CreateObject("ExcelGenerator.ARsTDesign")

Dim wbk As IXlsWorkbook
Set wbk = engine.New( "output.xps" )

Dim wksht As IXlsWorksheet
Set wksht = wbk.AddWorksheet("samplesheet")

wksht.Label(1,2) = "Hello world!"

wbk.Close

Set engine = Nothing
C# code
xlsgen.CoXlsEngine engine = new xlsgen.CoXlsEngine();

IXlsWorkbook wbk = engine.New( "output.xps" );

IXlsWorksheet wksht = wbk.AddWorksheet( "samplesheet" );
wksht.set_Label(1,2, "Hello world!");

wbk.Close();
C/C++ code
xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->New( L"output.xps" );

xlsgen::IXlsWorksheetPtr wksht = wbk->AddWorksheet( "samplesheet" );
wksht->Label[1][2] = L"Hello world!";

wbk->Close();

XPS files generated by xlsgen include cells and their formatting (including conditional formatting applied to it), pictures, charts, visual components (geomaps, ...) and databars. It also enforces a number of page setup options including : the print area, scale (two-way), page breaks, margins, header/footer, and so on.

 

Export as XLSB

The XLSB file format (B is for binary) is the binary version of XLSX files. A different file format made for performance in read and write (as a result of the lack of XML, for the most part). Supported features in the XLSB output are :

 

xlsgen documentation. © ARsT Design all rights reserved.