TFlexcelReport - Changing behvior on missing field

Hello,


My TFlexcelReport datalayer is bound via a dynamically created dataset. Those datasets are created at runtime by the user.

I'm using "Template" xlsx files that as predefined fields names  (ie. <#mydb.myfield>). 
Sometimes my users modify their dataset 'renaming or deleting exsiting fields) and they forgot to modify the Excel template. On this case TFlexcelReport.run will raise an exception because of some missing fields.

Would it be possible to modify this behavior by ignoring those missing fields? I mean having no exception and continuing generating the report. Maybe adding a published property like :

  • AbortOnMissingField , boolean preoperty
    • When true: actual behavior : an exception is raised
    • When false: no exception is raised, maybe letting the field value (ie <#mydb.myfield>)
Thank you

Hi,

Yes, this is possible. Just define a default for the filed, like <#mydb.myfield;> or <#mydb.myfield;missing>

See http://www.tmssoftware.biz/flexcel/doc/vcl/guides/reports-tag-reference.html#report-variable