Unable to display BIRT chart report in JSP page [message #115245] |
Wed, 25 January 2006 03:47  |
Eclipse User |
|
|
|
hi duds,
i created birt CHART report using BIRT report disigner.
after that i am accessing that in JSP but i am unable to display it.
same time i generated birt simple report( which contain TABLE ) .
but i am able to display the table report in JSP
Could u help me how to display Chart report in JSP.
Venkata r
|
|
|
|
|
|
|
|
Re: Unable to display BIRT chart report in JSP page [message #115491 is a reply to message #115454] |
Wed, 25 January 2006 07:24   |
Eclipse User |
|
|
|
Hi,
Unfortunately this doesn't give me much information, what is
BirtReportBinder? I think it if it's working for table reports, it's really
a configuration problem. Can you try to put an image in your report and see
if it works?
Please double check the instructions there
http://www.eclipse.org/birt/deploy/ There is also a sample application
included to show reports in web apps, you might want to try it as well.
Thanks,
David Michonneau
BIRT Committer
"venkatar" <venkatar@euclid.com> wrote in message
news:f06ad21ad005b2a0faa3c58eb7f5a7c1$1@www.eclipse.org...
> hi David Michonneau,
> thanks for immediate reply.
>
> this is Java file
> public String selectReport(){
>
> System.out.println("###########ReportBean.selectReport()
> Started########");
>
> String IKGO_HOME = System.getProperty("ikigo.home"); String reportDir
> =IKGO_HOME + "\\"+"reportTemplates";
>
> BirtReportBinder birtReportBinder = BirtReportBinder.getInstance();
> try{
> FacesContext facesContext = FacesContext.getCurrentInstance();
>
> /* Map params =
> facesContext.getExternalContext().getRequestParameterMap(); String source
> =(String)params.get("source"); StringTokenizer stk=new
> StringTokenizer(source,":");
> stk.nextToken();stk.nextToken();
> String reportIndex=stk.nextToken();
> String reportName=(String)reportList.get(Integer.parseInt(reportInd ex));
> */
>
> AdfFacesContext afContext = AdfFacesContext.getCurrentInstance(); String
> reportName =(String)afContext.getProcessScope().get("reportName");
> System.out.println("$$$$$$$$$ Report Name : "+reportName);
> String extName =".rptdesign";
> String reportPath = reportDir+"\\"+reportName+extName;
> System.out.println("$$$$$$$$$ Report Path : "+reportPath);
> Report reportObj = birtReportBinder.load(reportPath);
> ArrayList promptsList = reportObj.getPrompts();
> ByteArrayOutputStream byteArrayOutputStreamObj = new
> ByteArrayOutputStream();
> Iterator iter=promptsList.iterator();
> while(iter.hasNext()){
> Prompt prmpt=(Prompt)iter.next();
> if(prmpt.getSelectionList()!=null){
> Iterator iterSelectList=prmpt.getSelectionList().iterator();
> List selectList=new ArrayList();
> while(iterSelectList.hasNext()){
> SelectItem selectItem=new SelectItem();
> ParameterSelectionChoice
> paramChoice=(ParameterSelectionChoice)iterSelectList.next();
> selectItem.setLabel(paramChoice.getLabel());
> System.out.println("class of value"
> +paramChoice.getValue().getClass());
> if(paramChoice.getValue() instanceof String){
> selectItem.setValue(paramChoice.getValue());
> }else{
> selectItem.setValue(paramChoice.getValue().toString());
> }
> selectList.add(selectItem);
> }
> prmpt.setSelectionList(selectList);
> } }
> HttpSession session
> =(HttpSession)facesContext.getExternalContext().getSession(f alse); int
> count = promptsList.size();
> if (count == 0){
> ReportResult reportResultObj =
> birtReportBinder.execute(reportObj,byteArrayOutputStreamObj) ;
> session.setAttribute("OutputStreamObj",byteArrayOutputStreamObj);
> return "goto_reportResults"; }else{
> setReportObj(reportObj);
> return "goto_reportPrompts"; }
> }catch(Exception e){
> e.printStackTrace();
> }
>
> System.out.println("###########ReportBean.selectReport() Ended########");
>
> return null;
> }
>
> ------------------------------------------------------------ --------------
>
> This JSP file
>
> <%@ page session="true" %>
> <%@ page import="java.io.*" %>
>
> <html>
> <body>
>
> <%
> ByteArrayOutputStream outputStream =(ByteArrayOutputStream)
> sesssion.getAttribute("OutputStreamObj");
> out.print(outputStream);
> %>
>
>
> </body>
> </html>
>
>
> ------------------------------------------
>
>
> ONE THING TO TELL U
>
>
>
> THIS IS WORKING FINE WITH GENERAL TABLE REPORTS
>
> BUT ITS PROBLEM WITH CHART REPORTS
>
> PLEASE KINDLY HELP ME BECAUSE THIS IS URGENT SOLTION
> THANK U
>
> VENKATA r
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
Re: Unable to display BIRT chart report in JSP page [message #117054 is a reply to message #116984] |
Thu, 26 January 2006 03:05  |
Eclipse User |
|
|
|
Can you post a new message regarding this issue so that somebody familiar
with the sample app can help you?
Thanks,
David
"venkatar" <venkatar@euclid.com> wrote in message
news:0681ae012b6e26479e3e96e425885d10$1@www.eclipse.org...
> hi i saw the RunReport.java program and i run that program
> even this program is generating .html file for image reports but when i
> saw that image.html file no image is displaying in that file.
>
> the code is
>
> HTMLEmitterConfig hc = new HTMLEmitterConfig( );
> HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
> hc.setImageHandler( imageHandler );
> config.setEmitterConfiguration( HTMLRenderOption.OUTPUT_FORMAT_HTML, hc );
>
>
> // HTML reports can have embedded images or charts. Set up the
> configuration
> // required to write these into a directory in the output directory.
> // The HTMLCompleteImageHandler is one provided by BIRT for this purpose.
> // Your application can create a customized version to provide alternative
> // ways to handle images.
>
> i am not clear with the above comments. so could u please explain me
> clearly
>
> regards venkata r
>
> here in the comments its cleanly expl
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.27091 seconds