Hi Rakesh,
A colleague of mine had such a requirement way back, when Java Classes were still the "weapon" of choice to tackle similar challenges. He allowed me to share a method out of a bean class. It should be possible to translate that into an action script. Of course, not 1:1 but I'm sure you'll find the approach on how to handover parameters and open Report dialogues interesting. Here's his solution based on an Asset report:
public int runreport_from_line() throws MXException, RemoteException {
MXSession s = getMXSession();
MboSetRemote reportSet = s.getMboSet("REPORT");
DataBean assets = app.getDataBean("massmove_PlanMassSwapTable");
MboRemote mboAsset = assets.getMbo(assets.getCurrentRow());
String assetnum = mboAsset.getString("ASSETNUM");
String siteid = mboAsset.getString("SITEID");
String orgid = mboAsset.getString("ORGID");
String rptName = "assetdata.rptdesign";
String whereClause = "ASSET.ASSETNUM='" + assetnum + "' AND ASSET.SITEID='" + siteid + "' AND ASSET.ORGID='" + orgid + "'";
String appName = "ASSET";
reportSet.setQbe("appname", appName);
reportSet.setQbe("reportname", rptName);
reportSet.setQbeExactMatch(true);
reportSet.reset();
if (reportSet.count() == 0) {
Object[] params = { rptName };
this.clientSession.showMessageBox(this.clientSession.getCurrentEvent(), "reports", "noxml", params);
return 1;
}
MboRemote reportRec = reportSet.getMbo(0);
Integer rptNum = Integer.valueOf(reportRec.getInt("reportnum"));
String pageName = new StringBuilder().append("reportd").append(rptNum).toString();
if (this.clientSession.findDialog(pageName) == null) {
Object[] params = { pageName };
this.clientSession.showMessageBox(this.clientSession.getCurrentEvent(), "reports", "noxml", params);
return 1;
}
this.clientSession.loadDialog(pageName);
Hashtable<String, Object> reportInfo = new Hashtable<String, Object>();
reportInfo.put("reportnumber", rptNum);
reportInfo.put("whereclause", whereClause);
reportInfo.put("username", this.clientSession.getUserInfo().getUserName());
reportInfo.put("quickprinttype", "QL"); //QL: Web-Ansicht
reportInfo.put("qpnoprompt", "true");
this.clientSession
.handleEvent(new WebClientEvent("requestreportrun", pageName, reportInfo, this.clientSession));
return 1;
}
As you can see the first section tries to find the internal REPORTNUM which is used for the requestpage dialog. The second section shows how to put the parameters for the report together before it is executed using the requestreportrun event.
I hope this helps, even if it is not a ready-to-use copy+paste solution.
cheers
Johann