Cell format issue


we have a problem regarding cell formats. Our customer has a report that displays different data within a table. Everything works fine if data is available. But if no data is available, i.e. there have been no goods produced on a specfifc day, the cell format is lost. That means the borders of the table are missing. Is there a way to keep the cell format even if there is no data to display?

Kind regards


Can you try doing:
FlexCelReport.DeleteEmptyRanges = false;
before running the report?

If this doesn't fix it, can you send me 2 sample files (with and without data) to adrian@tmssoftware.com so I can see exactly what is happening?

Ok, thank you. I have sent you an E-Mail.


Thanks for the email. This is by design: If you set DeleteEmptyRanges = true (the default) then when there are 0 records the row will be completely removed and all the rows below will move up. The row will dissapear and with it all the formats on it.

If you set DeleteEmptyRanges = false, then the row isn't removed, but the row is cleared. No format or data will remain in the row.

You seem to be looking for a third option: That when there are 0 records the row isn't deleted, but the data is cleared (so you won't see <#db.field> tags), and the formats aren't cleared.

We can't add a third option to DeleteEmptyRanges, so we have deprecated it and introduced a new property: DeleteEmptyBands.

Setting FlexCelReport.DeleteEmptyBands = TDeleteEmptyBands.ClearDataOnly;

Should do what you excpect. The other 2 options available in DeleteEmptyBands correspond to the options before in DeleteEmptyRanges: Either delete the row or clear data and formats.

Please email me with your registration data and I'll send you a new version with the DeleteEmptyBands property.

Hello Adrian,

that is exactly what we need. Thank you for the fast solution. I have sent you an E-Mail.

Hello Adrian,

I also have another question not completely regarding cell formats but empty data. Is it (or will it be) possible to still process the FlexCel tags(functions) that are inside the cells?

For example if no data is available, there should be another text displayed: <#if(<#Query1.ROWCOUNT>=0;No Data;<#Query1.Text>)>.
At the moment these tags aren't processed and you wrote that with the new version the FlexCel tags will be removed with the option FlexCelReport.DeleteEmptyBands =   TDeleteEmptyBands.ClearDataOnly set. But for this specific example it would be great if the "if" tag would still be processed so the specific text would be displayed.


I've sent you an email with 6.6.25.

About evaluating tags in empty datasets, the tags are processed, but the problem is that if you have 0 records, they are repeated 0 times. The tag is repeated as many times as needed, if you have 5 records it will be repeated 5 times. It only makes sense that 0 records are removed (repeated 0 times).

For your particular case, you need to use ATLEAST tag in the config sheet. Take a look at the section: "Ensuring that a table has at least N Records" in EndUserGuide.pdf.

In the example you sent me you would:
1)Add a config sheet to the template. Just copy a config sheet from any of the examples.
2)At cells A10:B10 write:
Table Name Source Name Filter
Verbrauch_DO4 ATLEAST(Verbrauch_DO4_0;1;No data)

3)In the code, change the line where you define the datatable to be:
(I added a _0 at the end of the name so I can use it in the config sheet to generate the actual Verbrauch_DO4 but name it as you prefer)

Now when you run your example, if it has 0 records it will have 1 record with all the fields being "no data". In your template, you can check <#if(field="no data")> to do change the value of the field.

Hello Adrian,

thanks for the fast solution. But I have 1 report with a Master-Detail-Relationship where the cell format is not preserved when the master has no detail. I will send you an E-Mail with the template and report so you can take a look on it.

I've sent you a new link bye email which should fix this.

What really happens is that "0 records" don't really exist, so it is not that cell format isn't preserved: It was never copied. (In the original row in the template it was preserved as you noted, but not copied down)

But I agree that when using the new "preserve formats" mode, formats should be copied even if there are 0 records where to copy them too. So the fix I sent should fix this. Note that using "AtLeast" would have fixed this too.


Hello Adrian,

everything works now as expected. Thank you for your fast help!!