cancel
Showing results for 
Search instead for 
Did you mean: 

com.businessobjects.rebean.wi.DocumentInstanceImpl.setPrompts error

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Or, I moved the

                                reDocInst.setPrompts();

                                reDocInst.save();

out of for loop, the report can generate, but, no data.