cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve all the pages in the WEbi report when exporting to HTML

Former Member
0 Kudos

Hi,

We are currently having a webi report, whose content spans more than 100 pages.

We are trying to save the report using the BO SDK as HTML, but when we are saving as HTML we are getting only the first page of the report


				for(int i=0;i<doc.getReports().getCount();i++)
				{
					Report rep = doc.getReports().getItem(i);
//					get a view of the report in HTML format
					HTMLView docHtmlView = null;
					docHtmlView = (HTMLView)rep.getView(OutputFormatType.HTML);
					String sHTMLView = docHtmlView.getContent();
					System.out.println("The string is ::"+sHTMLView);
					FileOutputStream html_fos= null;
					 fileName = "POC" + "_" +i+ userID+ "."+"html";
					html_fos = new FileOutputStream("D:\\BO_POC\\reports\\"+fileName);
					html_fos.write(sHTMLView.getBytes());
					
					
				}

The above is the code that we are using to save the report in HTML format.

We are able to save the report in XLS, CSV and PDF successfully.

Can you please point out where we are going wrong in the above code snippet.

Thanks a lot,

Shruti

Accepted Solutions (0)

Answers (2)

Answers (2)

dan_cuevas
Active Participant
0 Kudos

Hi Shruti,

By default the pagination mode for viewing WebI reports is in Page Mode.

If you want to view the entire report in one html page then you will need to change this to Draft of Listing Mode.

Please note that using Draft or Listing Mode use up a lot of resources and for large reports it may encounter an error trying to pull all the data.

If you would like to test this out try adding the following code before retrieving the HTML View:

rep.setPaginationMode(PaginationMode.Listing);

Hope this helps.

Regards,

Dan

Former Member
0 Kudos

Hi Shruti,

I think this might be a limitation of the product. On the documentation you will see that for the Report interface the getView is detailed as "Get the view [...]" while for the DocumentInstance interface the method description is "Gets the whole document [...]".

Nevertheless, could you please try modifying the pagination mode of your report by invoking:

- report.setPaginationMode(...)

You should try both but Listing is the one I think could make a difference.

Thanks for letting me know.

David