I have a very simple printing form based on 1 entity including an unrelated tabpanel to print a many entity; records of the many entity are selected with a filter based on parameters defined from the user.
±----------------------+
| Form: VLPSTA52 |
| Table: VALUTAZIONI |
| |
|±--------------------+|
||Form: DTSSTA01 ||
||Table: DETTCONTSTRU ||
|±--------------------+|
±----------------------+
The application is in production. Users were reporting the generated preview/printout sometimes was not complete aka was not including all the records available in the database.
I have analyzed the issue reducing the complexity and I have discovered whatever code I use into the extracting method the behaviour is different the first time the preview/printout is executed compared to all following times.
I tried to code the simplified method I use to extract proper set of records in the many entity in 2 different ways:
CODE1:
forms.DTSSTA01.controller.find();
forms.DTSSTA01.dets_vltz = vltz_id;
forms.DTSSTA01.controller.search();
for ( var i = 1 ; i <= forms.DTSSTA01.controller.getMaxRecordIndex() ; i++ )
{
forms.DTSSTA01.controller.setSelectedIndex(i);
}
forms.DTSSTA01.controller.setSelectedIndex(1);
CODE2:
var query = "select dettcontstru.dets_id " +
“from dettcontstru where dets_vltz = " + vltz_id + " order by dets_ag_competenza, dets_stru”
forms.DTSSTA01.controller.loadRecords(query, null);
for ( var i = 1 ; i <= forms.DTSSTA01.controller.getMaxRecordIndex() ; i++ )
{
forms.DTSSTA01.controller.setSelectedIndex(i);
}
forms.DTSSTA01.controller.setSelectedIndex(1);
With BOTH code cases entering the application and executing this print preview is generating 10pages while from the second time the same print preview is generating 13pages. Further important info is in the first case (the erroneus one!) the many entity is stopping exactly at 200 records, the dimension of the step of the partial foundset.
There is no method associated at the onLoad in the printing form.
The error is happening both on Servoy Developer and Servoy Smart Client.
O.S.: WindowsXP Pro
Java: 1.5.0_13 or 1.6.0_03
Servoy: 3.1.7 (I did not tested the issued on Servoy 3.5 simply because I have not yet migrated to it!)
D.B. : iAnywhere 9.0.2
I feel this is a BUG related to cursor completition against the db during printing.
I would like someone will help to confirm, suggesting a workaround if available, and eventually solving the problem ASAP because it’s an application in production.
If more info are needed simply ask…
Tnks in advance,
Gianni