xlsgen bug fixes

Generate Excel files. Speed. Flexibility. Depth. Robustness.

 

Subscribe our RSS feed

xlsgen 5.0.0.34 : Fix for defined names


Build 5.0.0.34 of xlsgen follows the path of the previous build, this time fixing a scenario with defined names.

Posted on 27-May-2024 12:11 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.33 : Fix for undefined names


Build 5.0.0.33 of xlsgen fixes a problem related to undefined names in formulas. The fix updates formulas, when needed, even a part the specifies undefined names, that is defined names without an actual range associated to it. This is for XLSX files. XLS and XLSB formula bytecodes were already covering the scenario properly due to the bytecode nature of it.


Posted on 25-May-2024 15:08 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.32 : Theme-based rendering of pivot tables


Build 5.0.0.32 of xlsgen adds support for rendering theme-based pivot tables.

So essentially, we are doing this now (right) :


Theme-based pivot table rendering in xlsgen

Rendering occurs in print, preview, PDF, XPS.

Posted on 21-May-2024 12:00 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.31 : Fix for tables


Build 5.0.0.31 of xlsgen has a fix related to tables in Excel files (XLSX and XLSB).

Under certain circumstances, tables from an existing file, after being inferred, would interfere with the existing table specs, causing a corruption of the Excel file, seen by the user next time the file is opened in Excel.

Posted on 11-May-2024 12:12 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.30 : Fix for pivot tables


Build 5.0.0.30 of xlsgen improves how worksheet dimensions are calculated and used elsewhere by including pivot tables in it, including non-refreshed pivot tables.

Posted on 03-May-2024 09:57 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.29 : Creating in-place picture cell


Build 5.0.0.29 of xlsgen comes with support for in-cell picture metadata.

The first feature is exposed in the object model, at the cell level, a mechanism to add a picture whose boundaries are within the cell in question. More specifically the picture is resized to fit into that cell, and the X/Y ratio is preserved.

This is how you do it (here with C++) :

worksheet->Cell[3][4]->InPlacePicture = L"input\\picture.jpg"; // picture in cell D3


If that was all there was about it, that would be pretty small a thing. But there is more to it. What xlsgen does is create metadata in that cell, specifically picture metadata, which actually extends the capabilities of the cell. It can contain a number, a date, a string, a formula and now a picture. If then a formula is created elsewhere, making a reference to that cell, the picture is carried over. Making it possible to run new scenarios that were not possible before.

So if in F3 you write,

worksheet->Formula[3][6] = L"=D3";


then F3 has a picture in it !

Of course, many more complex formulas can be used in order to achieve actually useful scenarios.

If you print/preview/PDF/XPS export the worksheet, it will render the pictures created as such or referred to as such in formulas.

The metadata is written back to the file as long as the file is XLSX, XLSM or XLSB. If you open the resulting file and you are using Office 365, you will see the pictures if you are using an updated Office version. If you are using Excel 2021 or an older version however, no picture will be shown in Excel and you'll get an "#UNKNOWN!" error string in those cells instead. The Excel file isn't corrupted, it just can't support a feature that was written later on.

Posted on 28-April-2024 15:36 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.28 : Rendering picture metadata


Build 5.0.0.28 of xlsgen introduces the rendering of metadata pictures.

Whenever Excel is told to place a picture within the boundaries of a cell, a new feature, Excel actually stores the picture as metadata, which in turn allows to extend a cell's content. It's no longer limited to being empty, or storing a number, a date or a string. It can now store a picture. And because it can now store a picture, a formula can return a picture as well.

In this build, xlsgen makes sure that pictures stored in cells as metadata are rendered (print, preview, PDF, ...)


Rendering metadata pictures

Posted on 02-April-2024 22:15 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.27 : Fix pack for charts


Build 5.0.0.27 of xlsgen is a fix pack improving chart rendering in the following ways :

- plot area size isn't unnecessarily coerced by the legend box

- chart with categories in reverse order has its other axis seen correctly

- proper loading of T symbols from error bars in XLSX/XLSB charts

- rendering of custom error bars with cell ranges as plus or minus values

- rendering of data labels of type "cell range" introduced in recent Excel versions


To illustrate this, two examples. Notice how much better the charts are :


Plot area not coerced by legend


Error bars, plus data labels on Y axis

Posted on 27-March-2024 22:05 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.26 : Lower memory consumption (II)


Build 5.0.0.26 of xlsgen adds another round of memory optimizations, this time related to Infer() scenarios. Lower memory consumption, less fragmentation resulting in faster execution.

Infer() scenarios include the ability for xlsgen to discover tables inside a worksheet, including headers, data types and styles.


Posted on 21-March-2024 10:25 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.25 : Lower memory consumption


Build 5.0.0.25 of xlsgen reduces memory consumptions in a number of scenarios working with large files, that is importing data (CSV/XML/JSON/HTML), inferring worksheets and duplicating worksheets. Memory reduction is designed to make it more scalable as the data grows.

Posted on 13-March-2024 18:08 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.24 : Memory corruption fix


Build 5.0.0.24 of xlsgen has a fix related to memory corruption.

The scenario includes opening and updating a XLSX or XLSB file with a long file path (possibly due to sub-folders). A workaround to the fix is, instead of opening X and saving as X, to open as X and save as Y, assuming Y is later renamed to X or whatever. Also a workaround consists in saving to memory, thereby with all the freedom to write back as a file later on.

Posted on 23-February-2024 12:24 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.23 : Fix for chart smooth lines


Build 5.0.0.23 of xlsgen fixes a problem related to duplicating smooth lines in line/scatter charts in XLSX/XLSB files.

Recent Excel versions differ on how they act on the default value on the smooth line option and as such we did see different appearance depending on the Excel version being used to open the files. xlsgen makes sure to avoid default values on the smooth line option.

Posted on 13-February-2024 15:25 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.22 : Fix pack


Build 5.0.0.22 of xlsgen is a fix pack. Includes the following fixes :

- better rendering of date axis in charts wherever applicable. For instance, the number of labels along the axis is made so it's more readable.

- improved shape size compute for rendering purposes.

Posted on 31-January-2024 21:26 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.21 : Print Row and Col headings (II)


Build 5.0.0.21 of xlsgen improves printing row and column headings (print, PDF, ...). It clips shapes and other objects so they don't overlap headings.

Posted on 30-January-2024 08:39 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.20 : Functions GROUPBY, PIVOTBY, PERCENTOF


Build 5.0.0.20 of xlsgen adds read and write support for the following functions :


  • GROUPBY : allows you to create a summary of your data via a formula. It supports grouping along one axis and aggregating the associated values. For instance, if you had a table of sales data, you might generate a summary of sales by year. Syntax : =GROUPBY(row_fields,values,function,[field_headers],[total_depth],[sort_order],[filter_array])
  • PIVOTBY : allows you to group, aggregate, sort, and filter data based on the row and column fields that you specify. Syntax : =PIVOTBY(row_fields,col_fields,values,function,[field_headers],[row_total_depth],[row_sort_order],[col_total_depth],[col_sort_order],[filter_array])
  • PERCENTOF : returns the percentage that a subset makes up of a given data set. Syntax : =PERCENTOF(data_subset,data_all)


Functions are available from Microsoft in Excel 365. In beta at the time of writing.

Posted on 26-November-2023 14:40 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.19 : Preserving Python in Excel files


Build 5.0.0.19 of xlsgen ensures that Excel files storing Python functions coming from the recent Python in Excel feature introduced by Microsoft are preserved as is.

Most notably, supporting reading and writing the new PY() function.

xlsgen does not run Python script however. If you want to use xlsgen and Python together, you can load xlsgen from a python environment and continue from there. This has been available forever.

Posted on 29-October-2023 11:07 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.18 : PowerShell scripting


Build 5.0.0.18 of xlsgen adds support for running Windows PowerShell scripts.

Windows PowerShell is part of Windows and is more security-aware than other scripting languages such as VBScript and JScript. Since it can create and run COM object instances, and expose the object model to the client application, it is important to make it available to everyone in the context of xlsgen applications. Windows PowerShell scripts are .ps1 files.

And PowerShell is one of the available programming language targets available in the automatic source code generation tool that comes with the xlsgen install so you can get going in a snap.



Build 5.0.0.18 comes with a code sample (/samples/PowerShell) that creates a simple worksheet. A copy of it is below.

Note that the xlsgen object model has constants (enumerated types) that PowerShell does not expose after reading the xlsgen type-library so we are making available, also in code samples, a file called xlsgen.ps1 that exposes all constants available from the object model.

Below is a code sample using PowerShell :


# Produced by xlsgen code generator (c) ARsT design.
# For more info, see http://xlsgen.arstdesign.com
#
# To use this code in your PowerShell script editor, remember to add the
# xlsgen constant-library with the following statement :
# .samples/PowerShell/xlsgen.ps1
#
# In order to import the .ps1 script, make sure to run PowerShell as admin and
# set the appropriate execution policy as in :
# Set-ExecutionPolicy RemoteSigned
# which allows to run the .ps1 script within a console
#

$engine = new-object -ComObject ExcelGenerator.ARsTDesign
$workbook = $engine.New( "C:\tmp\myfile.xlsx" )

$wksht001 = $workbook.AddWorksheet( "Sheet1" )

$wksht001.Cell(1,2).HtmlFloat = "<font color=#000000 size=11 name=""Calibri"">154</font>"
$wksht001.Cell(1,3).HtmlLabel = "<font color=#000000 size=11 name=""Calibri"">this is a test</font>"
$wksht001.Cell(3,3).HtmlFloat = "<font color=#000000 size=11 name=""Calibri"">1</font>"
$wksht001.Cell(4,3).HtmlFloat = "<font color=#000000 size=11 name=""Calibri"">2</font>"

$workbook.Close()


Posted on 13-October-2023 19:00 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.17 : Advanced data sorting (II)


Build 5.0.0.17 of xlsgen complements build 5.0.0.15 related to sorting data. It comes with the following features :

- support for sorting horizontally

- support for merged cells inside the sort area. Merged cells are preserved if they satisfy a number of logical constraints, otherwise the cells are unmerged.

- support for sorting inside auto-filters. A Sort property is now available in the auto-filter object, and saved as such in the file so you can combine sorting and filtering.

Posted on 08-October-2023 18:41 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.16 : Fix for page breaks


Build 5.0.0.16 of xlsgen fixes a problem related to page breaks in XLSX and XLSB files which appears in Excel's user interface.

Excel can't handle print areas made of adjacent areas, as it breaks print previews in Excel, so a special flag is added to disable the problem altogether.

Posted on 29-September-2023 19:27 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

xlsgen 5.0.0.15 : Advanced data sorting


Build 5.0.0.15 of xlsgen adds advanced data sorting. Before this build, sorting on values was already available. This build adds the following :

  • on values
  • on cell color : background cell color or font color
  • on associated icon (related to icon-based conditional formatting)



This is illustrated as follows :



Sort on values (ascending) by column C




Sort on background cell color (descending) by column D




Sort on cell font color (ascending) by column E




Sort on icons (ascending) by column G


Any number of sort conditions can be added (up to 3 if you target XLS files) so if you'd like to sort on column C then on column D, the corresponding conditions can be added to the tree of conditions, accordingly.

Here is an example for sorting on background cell color :

C++ code


xlsgen::IXlsWorkbookPtr wbk = engine->Open( L"data.xls", L"output.xls" );

xlsgen::IXlsWorksheetPtr wksht = wbk->WorksheetByIndex[1];

xlsgen::IXlsRangePtr r = wksht->NewRange(L"C4:F7");
xlsgen::IXlsSortPtr sort = r->NewSort();

xlsgen::IXlsSortConditionPtr sc = sort->NewCondition();

sc->SortOnWhat = xlsgen::sortcondition_oncellbkgndcolor; // cell background color is used as sort criteria
sc->columnIndex = 2; // 2nd column of the range, i.e. column D
sc->SortColor = 0xFFFF00; // 0xFFFF00 = yellow

sort->Apply();



And another one for sorting on icons (related to existing conditional formatting of type icon) :

C++ code


xlsgen::IXlsWorkbookPtr wbk = engine->Open( L"data.xls", L"output.xls" );

xlsgen::IXlsWorksheetPtr wksht = wbk->WorksheetByIndex[1];

xlsgen::IXlsRangePtr r = wksht->NewRange(L"C4:F7");
xlsgen::IXlsSortPtr sort = r->NewSort();

xlsgen::IXlsSortConditionPtr sc = sort->NewCondition();

sc->SortOnWhat = xlsgen::sortcondition_onicon; // cell icon is used as sort criteria
sc->columnIndex = 4; // 4th column of the range i.e. column F
sc->SortIconset = xlsgen::iconset_3trafficlights_unrimmed; // icon set to match
sc->SortIconsetIndex = 1; // which icon in iconset to match (1-based)

sort->Apply();




Posted on 29-September-2023 16:26 | Category: xlsgen, Excel generator | Tags: generating Excel spreadsheets

 

 

<-- previous page