Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

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.

Former Member
Not what you were looking for? View more on this topic or Ask a question