I have some FPMI code that runs several SQL proceedures and builds/populates an SQL table. It then opens a new window with the report for that table so the user can print it. The problem is that when the reporting window opens, there is no data in it. The report shows up, but there are no fields filled in. There is an option on the first window to reprint the report. If I close the reporting window and choose reprint, the reporting window pops up again and this time it is populated. I don’t know if there is a way to be sure the table write is completed before running the report, or if I can set a delay for 5 seconds while the table is populated?
The code looks something like this:
BBTID = fpmi.db.runScalarQuery("exec dbo.usp_BBTCreateNewRecord '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'" % (dt,dd,mm,yy,brand,tank,dest,cond))
table = event.source.parent.getComponent("ctrFermenters").getComponent("tblSelFerm")
order = table.getRowsInViewOrder()
for row in order:
fpmi.db.runUpdateQuery("exec usp_BBTLinkFermentersTemp '%s', '%s'" % (BBTID,table.data.getValueAt(row,0)))
fpmi.db.runUpdateQuery("exec usp_FiltrationLogFermCO2 '%s'" % (BBTID))
if brand == "SFB":
fpmi.nav.openWindow("Filtration Log2")
elif cond == 1:
fpmi.nav.openWindow("Filtration Log1")
else:
fpmi.nav.openWindow("Filtration Log2")
There are two versions of the report, but Filtration Log1 and Filtration Log2 are populated from the same table.