mhsabado escribió el lun, 16 diciembre 2013 11:02
The :DelDataSet(oDS) deletes the oDS and the respective element value in :aDataSets is replace with NIL. This is causing problem in the displayed data of my report. I made a workaround (by copying to temporary array) to remove the element with NIL value from the :aDataSets and the report now displays the correct data.
Is it possible to automatically resize the :aDataSets when :DelDataSet is executed? Even using ADel() with lShrink set to true didn't help because a NIL value is still present.
Could you explain WHY you delete the dataset?
I can not understand why you have problems on the displayed data of your report. Are you using data fields from the deleted dataset? I guess not.
I have modified our console demo program with this code and is working nicely with absolutely no errors:
WITH OBJECT oReport := TFastReport():New()
oDs := :AddArray( "Dir1", Directory( "*.*" ), cStruct )
:AddArray( "Dir", Directory( "*.*" ), cStruct )
:DelDataset( oDs )
BTW, the element is replaced by NIL to avoid the use of ASCAN on the event subsystem, so to say, to gain speed.