on 2012 May 16 8:00 PM
I have code works in old version, as:
ReportEngine reportEngine = getReportEngine(session, reportEngines);
DocumentInstance reDocInst = (DocumentInstance) reportEngine.openDocument(webiDoc.getID());
Prompts prompts = reDocInst.getPrompts();
for (int j = 0; j < prompts.getCount(); j++) {
Prompt prompt = prompts.getItem(j);
String promptName = prompt.getName();
String bindName = (String) promptMap.get(promptName);
String promptval = request.getParameter(bindName);
System.out.println("name="+promptName+ " value="+promptval + " Bind Name="+bindName);
String[] vals = null;
if (promptval.equals("CurrentMonth")) {
vals = new String[2];
vals[0] = "CurrentMTD";
vals[1] = "CurrentFut";
prompt.enterValues(vals);
PromptsUtil.populateWebiPrompts(prompts, webiDoc);
...
}
Since the PromptsUtil.populateWebiPrompts can't used anymore, I code as:
ReportEngine reportEngine = getReportEngine(session, reportEngines);
DocumentInstance reDocInst = (DocumentInstance) reportEngine.openDocument(webiDoc.getID());
Prompts prompts = reDocInst.getPrompts();
for (int j = 0; j < prompts.getCount(); j++) {
Prompt prompt = prompts.getItem(j);
String promptName = prompt.getName();
String bindName = (String) promptMap.get(promptName);
String promptval = request.getParameter(bindName);
System.out.println("name="+promptName+ " value="+promptval + " Bind Name="+bindName);
String[] vals = null;
if (promptval.equals("CurrentMonth")) {
vals = new String[2];
vals[0] = "CurrentMTD";
vals[1] = "CurrentFut";
prompt.enterValues(vals);
reDocInst.setPrompts();
reDocInst.save();
}
...
}
When I execute the code, I have:
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} Caused by: java.lang.NullPointerException
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at com.businessobjects.rebean.wi.DocumentInstanceImpl.setPrompts(Unknown Source)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at com.ihg.rbi.action.ReportListAction.scheduleWebiReport(ReportListAction.java:502)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at java.lang.reflect.Method.invoke(Method.java:597)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
[14:31:25.589] {hmux-127.0.0.1:6800-4$1319874444} ... 13 more
If I removed the reDocInst.setPrompts();
then, I can execute the program, and remove me a report with no data.
I want to know where the problem cause this. And, it is really difficult to find document about this kind issue of BO upgrade.
I really appreciate your help.
Thanks.
Request clarification before answering.
Or, I moved the
reDocInst.setPrompts();
reDocInst.save();
out of for loop, the report can generate, but, no data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.