Home
Analytics
How to update a field in birt
Lolita
Hello All,
I create a report in BIRT and I need to update a field in the Table after the user runing the repport. Any idea how to do this.
Thanks alot and I apriciate your help.
Have a grat day
Find more posts tagged with
Comments
Hans_vd
Hi,
This might be a solution:
It is possible to create a dataset based on a stored procedure instead of a query. So you could create some kind of dummy dataset based on a stored procedure that does the update. So it is not really done "after" the report, but rather "during" the execution of the report.
Let me know if this works for you...
Lolita
Thanks Bro for your time,
I resolved the problem like the following:
1. In Open method i did:
updateLabelPrint = MXReportTxnProvider.create("maximoDataSource");
2. In fetch method, I create the statement and put it in VarSession :
request = reportContext.getHttpServletRequest();
session = request.getSession();
updateLabelPrintSQL = updateLabelPrint.createStatement();
updateLabelPrintSQL.setQuery(" update matrectrans set cg_labelprint = 1 where matrectransid = '"+row["matrectransid"]+"' ");
session.setAttribute("variableSession", updateLabelPrint);
3. In beforeClose method I save it :
request = reportContext.getHttpServletRequest();
if(request != null){
session = request.getSession();
updateLabelPrint = session.getAttribute("variableSession");
if ( updateLabelPrint != null ) {
updateLabelPrint.save();
updateLabelPrint = null;
}
}
Thanks again have a great day