One of our customers wants to view reports same as they view in BO 6.5 version. In that version you can view all pages of one report in one page with page breaks. In BO 3.1 version you can not able to see that kind of view. You able to see in Draft mode, which do not put page breaks, Page mode , which you are not able to see whole report in one page, etc.
At starting we didn’t want to give a solution for this kind of problem because InfoView application is not producing any solution for this problem but when money talks we have to produce a solution.
In this entry I try to explain what we are doing and you can able to get code sample here
When producing it seems too easy for me
and here I will try to explain what you will do with steps.
Step 1. setPaginationMode to PaginationMode.Page , with this we will take all report page and page. And getView with ;
HTMLView cdzHtmlView = (HTMLView) report.getView(OutputFormatType.DHTML)
Step 2. loop all over the reports. For this get report pages number (If you are not sure to get the page size like me you can do below code )
PageNavigation cdzPageNavigation = report.getPageNavigation();
cdzPageNavigation.last(); // take navigation to last page
int lastReportId = cdzPageNavigation.getCurrent(); // getCurrent page number, which implies last page
Step 3. get Report Html content with ;
StringWriter sw = new StringWriter();
String s1 = “” , s2 = “”;
cdzHtmlView.getContent(sw,s1,s2);
String strContent = sw.toString();
Step 4. Play with css of the taken htmlView content. (indexOf is for protection not to get an Exception )
if(strContent.indexOf(“absolute;”)> 0){
strContent = strContent.replaceAll(“absolute;”, “relative;”);
}
Step 5. Write html to outputsream and continue with next page ;
outPutStream.write(strContent.getBytes(“ISO-8859-9″));
cdzPageNavigation.setTo(i+1);
i++;
Step 6. Finish your work with flush method.
outPutStream.flush();
With this sample you will be able to get a view of your report in one page with all pages which are seperated with page breaks.
In this sample I didn’t try to get DocumentInstance, ReportEngines or other staffs. I hope you know how to get them for use. If you don’t know let me know and I can try to explain them too.
Pingback: Different View Mode Ext. | Sabri Eker
Lastly, I observed the data I used to be seeking for. I have been undertaking study on this subject, and for 4 days I sustain finding web-sites that happen to be supposed to have what I am researching for, only to be frustrated aided by the lack of what I desired. I wish I could have located your internet site quicker! I had about twenty five% of what I was in search of and your site has that, as well as relaxation of what I wanted to finish my study. We’ve activated to this web site most suitable here I like that you’ll discover authentic content articles that you can hardly discover elsewhere. Thank goodness, you are able to uncover nonetheless these sorts of weblogs, make certain you go on! I can no longer see the well-known media. It is there loads rubbish revealed, I bear it no far more soon. A genuinely pleasurable blog and outstanding article. I expend days on the online reading blogs, about tons of distinct subjects. I must 1st of all give kudos to whoever designed your web-site and 2nd of all to you for writing what i can only describe as an publish. I honestly feel there is a talent to writing article content that only a number of posses and frankly you may have it. The blend of informative and high-quality content material is unquestionably tremendously rare together with the huge amount of weblogs about the web.Keep a good perform!