How to sort a report that uses split

We use Flexcel to generate a HTML report.
I have a HTML report based on a excel template that I like to sort, but I don't get the sorting working.
this is the config in the template I have now.


this is the template

image

And this is what the resulting HTML looks like


I had expected on the first row the names with an A.
How should I config the sorting?

Hi,
Maybe if you can send the template it would be simpler for us to figure out what is happening, since there is a lot I can't see in the screenshots.

But from what I see in the images, it looks like you defined a table ArtikelenMaster sorted by artikel_omschrijving. But then in the template, it looks like you are using <#artikelen.artikel_omschrijving> instead of <#artikelenMaster.artikel_omschrijving> ?

remember that only ArtikelenMaster is sorted, Artikelen is not.

I also tried to add Artikelen as a table with sorting, but also did not sort it.
I have enclosed the template
Flexcel_Template.xlsx (12.1 KB)

The thing is, FlexCel will never sort Artikelen. It does not sort existing tables, it creates new tables sorted which are based in existing ones.

So, to use the sort functionality you could:

  1. rename all cells in the spreadsheet from say <#artikelen.kenmerk1_waarde> to <#artikelenMaster.kenmerk1_waarde>
    In this template you are using artikelen everywhere, and artikelen isn't sorted.

  2. Other solution to avoid rewriting all cells in the template would be to not pass "artikelen" with addtable to the template. You would do a AddTable("artikelen_unsorted", ...), then in the config sheet define:

|Artikelen| artikelen_unsorted | |Artikel_Omschrijving asc

This way, artikelen will be sorted (artikelen_unsorted won't be, but you won't use that anywhere)

  1. Finally, the simplest solution if you are using an SQL db to get the data, might be not to use the SORT functionality in the config sheet, and make sure artikelen is sorted when you do the SQL to retrieve the data. Just add a Sort By to the SQL.

Thanks for the solutions. I went with option 2 and it works great.