cancel
Showing results for 
Search instead for 
Did you mean: 

Could not get page number. (Error: RWI 00223)

Former Member
0 Kudos

Hi

I am using the following code to open a webi scheduled instance in Excel format.But I am getting a error n the highlighted line.

try

{

int intDocID = Integer.parseInt(strDocID);

String userName = (String) BoeUtil.getSessionVariable(request, SessionAttributes.RPT_USER);

IInfoStore iStore = (IInfoStore) BoeUtil.getInfoStore(request, userName);

String strQuery = QueryBuilder.viewDocument(strDocID);

IInfoObjects iDocuments = iStore.query(strQuery);

IInfoObject iDocument = (IInfoObject) iDocuments.get(0);

String strKind = iDocument.getKind();

// Instantiate appropriate ReportEngine according to

// document type ReportEngine repEng = null;

ReportEngines reportEngines = (ReportEngines) BoeUtil.getReportEngines(request, userName);

ReportEngine repEng;

if (strKind.equals("Webi")) repEng = reportEngines.getService(ReportEngineType.WI_REPORT_ENGINE);

else repEng = reportEngines.getService(ReportEngineType.FC_REPORT_ENGINE);

if (strKind.equals("Webi"))

{

DocumentInstance doc = repEng.openDocument(intDocID);

response.reset();

response.setContentType("application/vnd.ms-excel");

response.setHeader("Content-Type", "application/vnd.ms-excel");

response.setDateHeader("expires", 0);

com.businessobjects.rebean.wi.Report report = doc.getReports().getItem(0);

report.setPaginationMode(PaginationMode.Listing);

logger.debug("Pagination Mode"+report.getPaginationMode());

Object docBinaryView = report.getView(OutputFormatType.XLS);

// output the binary stream via the response object

byte[] abyBinaryContent = ((BinaryView) docBinaryView).getContent();

response.getOutputStream().write(abyBinaryContent);

The exception says Could not get page number. (Error: RWI 00223)

I have triedcopying all the jars from infoview.And the doc Id is also checked but still I am facing this exception.

I am usig XiR2 and this is working fine in infoview.

Accepted Solutions (0)

Answers (1)

Answers (1)

atul_chowdhury2
Active Participant
0 Kudos

Hi -

Page numbering does not exist when a report's PaginationMode is set to Listing. It's like telling a submarine to drive with wheels it doesn't have on a road it's not on.

Hope this helps

Former Member
0 Kudos

It does not even work when I do not set pagination mode to Listing.It gives me the same exception when pagination mode is page.

atul_chowdhury2
Active Participant
0 Kudos

I must apologize - despite my interesting submarine analogy, listing mode actually does work fine when retrieving pagination objects - so let's eliminate that from this discussion.

I just installed the sample for XLS output w/ report pagination and it works like a charm::

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0de9a5c-b766-2b10-d5ba-b8305edf...

Can you try and implement this sample and see what it comes up with?