In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

:DelDataSet Question

FastReport for Xailer & [x]Harbour (English/Spanish)
mhsabado
Posts: 3
Joined: Sun Nov 17, 2013 7:34 am

:DelDataSet Question

Postby mhsabado » Mon Dec 16, 2013 11:02 am

Hi,
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.
Thanks,
Mario
User avatar
ignacio
Site Admin
Posts: 8693
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

:DelDataSet Question

Postby ignacio » Tue Dec 17, 2013 12:43 pm

mhsabado escribió el lun, 16 diciembre 2013 11:02
Hi,
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.
Thanks,
Mario

Hello,
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.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
mhsabado
Posts: 3
Joined: Sun Nov 17, 2013 7:34 am

:DelDataSet Question

Postby mhsabado » Wed Dec 18, 2013 5:47 am

Hi Ignacio,
I have a function in my code that I just passed the dbf files and relations as parameters. Each dbf was added to report as DS. For dbf files that have relations, they were assigned to another DS (i.e., oDS:= :AddDbf(cAlias ,{"cAlias1->*","cAlias2->*"}). Since the related tables have been merge to a separate DS, I wanted to delete the other DS assigned to each individual dbf files to avoid redundancy. Although the MasterData in my report was assigned with DS that has relations, when a NIL exist in the :aDataSets, the report only displays up to 4 pages for the 70k records. If I try to issue ASize() to :aDataSets to eliminate the NIL element, the problem goes away and the 70k records are displayed. I don't have idea why the NIL element in :aDataSets affects my report.
Regards,
Mario
User avatar
ignacio
Site Admin
Posts: 8693
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

:DelDataSet Question

Postby ignacio » Wed Dec 18, 2013 10:55 am

mhsabado escribió el mié, 18 diciembre 2013 05:47
Hi Ignacio,
I have a function in my code that I just passed the dbf files and relations as parameters. Each dbf was added to report as DS. For dbf files that have relations, they were assigned to another DS (i.e., oDS:= :AddDbf(cAlias ,{"cAlias1->*","cAlias2->*"}). Since the related tables have been merge to a separate DS, I wanted to delete the other DS assigned to each individual dbf files to avoid redundancy. Although the MasterData in my report was assigned with DS that has relations, when a NIL exist in the :aDataSets, the report only displays up to 4 pages for the 70k records. If I try to issue ASize() to :aDataSets to eliminate the NIL element, the problem goes away and the 70k records are displayed. I don't have idea why the NIL element in :aDataSets affects my report.
Regards,
Mario

Hi,
If you will not use some DBFs except as a relation then consider to not include them at all on the report. I'm afraid the execution pensalty is on adding a dataset and afterwards destroying it. Once is added is not worth to destroy it.
BTW, try to reproduce your problem with our console demo and I will have a look.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com

Return to “FastReport”