Flexcel <#delete sheet> not working as doc

This technique is not working as shown in documentation:

I use: <#=(<#Config>!N12)> ; in N12 I have: <#if(<#MyBooleanValue>;Mysheetname;<#delete sheet>)>

And I'm getting the sheet generated and named "_" .
image

Please, help.

By the way, I noticed when I put <#delete sheet> as the sheet name, it is correctly deleted, but I still must provide tables referenced by band names defined just for that sheet (not global). Shouldn't it ignore those named ranges when the sheet is to be deleted ?

BTW2:

As I could not delete sheets, and even when deleted, the tables were required, I had to send the empty lists.

When doing this, it started raising an argument out or range when I run the report:

image

Seems like it's trying to get Lists first item without cheking it's count.

It worries me, because those lists are empty because of users filters. I can solve report layout using <#if(<#MyTable.#RowCount> = 0;<#delete row>;)> all over it, but I can't avoid empty Lists when users apply filters. Doesn't it deserve a fix?

ReportsFromLists demo. If you delete/comment all lines of LoadCategories method, you'll endup with an Argument out of range error.

I couldn't reproduce your issue with delete sheet, is there something extra that you are doing that you think could be causing this?
I attach a simple example here:
deletesheet.zip (15.0 KB)

It deletes the sheet, and the name tomato (along with the <#tomato.test> field) are not required to be filled in, as the sheet is deleted before it is parsed.
I am not sure on what could be happening here. Do you think you can modify this test app to make it reproduce what you are seeing?

I can solve report layout using <#if(<#MyTable.#RowCount> = 0;<#delete row>;)>

There is no need for that, you can just set report.DeleteEmptyBands := TDeleteEmptyBands.MoveRangeUp;

ReportsFromLists demo. If you delete/comment all lines of LoadCategories method, you'll endup with an Argument out of range error.

I'll investigate this and let you know. It seems related to the master detail, because it is trying to get data from the detail when there is no master, so there are no details. I'll check what can be done, but in a general case (say you delete both detail ranges in that template and the fields), the empty list should be handled fine. This seems to be an special case, we'll see to fix it

I'll investigate. I made a test, at first changed the wrong boolean parameter, as of the report.create; but then I changed the SetValue parameter, and it's ok. No error, no table required. I don't know what may have my sheet that would make it fail.

There are other pages, the config sheet has other stuff, there are many named ranges.
II'll investigate it.

:woozy_face:
Unbelievable!

There was a space at the end of the expression in <#Config>!N12 , and it made all this mess!

It was: "<#if(<#MyBooleanValue>;Mysheetname;<#delete sheet>)> " <<== extra space here!

If you check the call stack, it's trying to get the master first item, but there's none.

With this ReportsFromLists demo I could solve it with the delete sheet strategy (<#if(<#categories.#rowcount>=0;<#delete sheet>;Things)>) (Had to create a dumb sheet, as it cannot generate a workbook with no sheets).

Meanwhile, I'll put my lists bands on distinct sheets and apply the same logic. The problem is that it forces page breaks(distinct sheets), and the report has many little lists that could fit together. But considering some of them may come empty, that seems to be the only way right now.

Yes, as the detail is a field of the master, it is trying to get it and the master has no records. It has been fixed internally, next release will have it fixed. But if you want it earlier, write to adrian@tmssoftware.com and I can send you a prerelease with only that change.

1 Like