Hello erveryone,
I have a report with two custom properties.
The user selects one or more rows from a table and clicks a button to print the relative labels.
The problem is that a multiple selection does not update the report parameters and I basically get the same label printed n times.
I have debugged the code and I can see that in the for loop the data I expect is infact correct
I have tried to add an invokelater function to pause the code for the report to update but it’s not working.
What am I missing ??
Thanks in advance,
t = event.source.parent.getComponent('Table')
t1 = t.getTable()
# righe selezionate
sr = t1.getSelectedRows()
# totale righe selezionate
src = t1.getSelectedRowCount()
def refresh():
if nome_stampante != '':
reportViewer = event.source.parent.getComponent('Report Viewer')
reportViewer.print(nome_stampante, False)
for x in sr:
order_id = t1.getValueAt(x, 0)
codice = t1.getValueAt(x, 2)
event.source.parent.getComponent('Report Viewer').CODICE = codice
event.source.parent.getComponent('Report Viewer').ORDER_ID = order_id
#system.gui.messageBox(str(codice) + ' ' + str(order_id),'')
system.util.invokeLater(refresh,2000)
#exit()