Skip to main content



      Home
Home » Archived » BIRT » Unable to display BIRT chart report in JSP page
Unable to display BIRT chart report in JSP page [message #115245] Wed, 25 January 2006 03:47 Go to next message
Eclipse UserFriend
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 #115295 is a reply to message #115245] Wed, 25 January 2006 04:55 Go to previous messageGo to next message
Eclipse UserFriend
hi floks ,
it's urgent solution

please help me
Re: Unable to display BIRT chart report in JSP page [message #115346 is a reply to message #115245] Wed, 25 January 2006 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I can help you, but I need more information. Can you send me your report
design and jsp code so I can take a look? Do you see any error message in
the log or elsewhere?

Are you sure to have deployed your application correctly? Please check this
page: http://www.eclipse.org/birt/deploy/

Thanks,

David Michonneau
BIRT Committer

"venkata r" <venkatar@euclid.com> wrote in message
news:f29482eeb394f8a39a7ffb7bc6ab2daa$1@www.eclipse.org...
> 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 #115431 is a reply to message #115346] Wed, 25 January 2006 06:24 Go to previous messageGo to next message
Eclipse UserFriend
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);
%>
</metrikus:tableformat>

<%@include file="../common/footer.inc" %>

</f:view>

</body>
</html>
Re: Unable to display BIRT chart report in JSP page [message #115444 is a reply to message #115346] Wed, 25 January 2006 06:26 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Unable to display BIRT chart report in JSP page [message #115454 is a reply to message #115346] Wed, 25 January 2006 06:27 Go to previous messageGo to next message
Eclipse UserFriend
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 #115491 is a reply to message #115454] Wed, 25 January 2006 07:24 Go to previous messageGo to next message
Eclipse UserFriend
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 #115557 is a reply to message #115491] Wed, 25 January 2006 07:51 Go to previous messageGo to next message
Eclipse UserFriend
hi

i generated report with image using designer and tryed to display that in
JSP its not showing any error but its not displaying that image in JSP.

currently i am using birt-report-framework-1_0_1.zip to generate
reports.

Thank U,
venkatar
Re: Unable to display BIRT chart report in JSP page [message #115613 is a reply to message #115557] Wed, 25 January 2006 08:02 Go to previous messageGo to next message
Eclipse UserFriend
This is a typical problem, please search the newsgroups for a resolution, it
has been answered several times I think. I quickly look and it seems you
need to call this at some point: HTMLRenderContext renderContext = new
HTMLRenderContext();
task.setContext(renderContext);

Thanks,

David Michonneau
BIRT Committer

"venkatar" <venkatar@euclid.com> wrote in message
news:1c8d3bb1df768e049286617fa34f0cef$1@www.eclipse.org...
> hi
> i generated report with image using designer and tryed to display that in
> JSP its not showing any error but its not displaying that image in JSP.
>
> currently i am using birt-report-framework-1_0_1.zip to generate
> reports.
>
> Thank U,
> venkatar
>
Re: Unable to display BIRT chart report in JSP page [message #115651 is a reply to message #115613] Wed, 25 January 2006 08:48 Go to previous messageGo to next message
Eclipse UserFriend
hi
i am using follwoing code for out put

HTMLRenderOption options = new HTMLRenderOption( );
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML) ;
options.setOutputStream(out);
task.setRenderOption( options );
task.setParameterValues( hmap );

i am displaying table reports with this code but not chart and image
reports

thanks
venkata r
Re: Unable to display BIRT chart report in JSP page [message #115677 is a reply to message #115651] Wed, 25 January 2006 09:20 Go to previous messageGo to next message
Eclipse UserFriend
hi
i did not fine the code how to display report with image in previous posts.
could u send me code how to display a image or table or chart report in
standalone java program

please help me
using that code i can solve my problem

regards
venkata r
Re: Unable to display BIRT chart report in JSP page [message #115714 is a reply to message #115677] Wed, 25 January 2006 09:32 Go to previous messageGo to next message
Eclipse UserFriend
There you go:

"Jun Zhai" <jzhai@actuate.com> wrote in message
news:<2769a605a0c7d26a642e29a2aeda9f52$1@www.eclipse.org>...

> Vikas,

>

> You have to set the image directory and base image URL right like this

> below:

>

> HTMLRenderContext renderContext = new HTMLRenderContext( );

> renderContext.setImageDirectory( EngineAccessor.ImageDirectory );

> renderContext.setBaseImageURL( request.getContextPath( ) +

> EngineAccessor.ImageBaseUrl );

>

> The image base url will be used to construct the URL of your embedded

> image/chart in the report. The image directory is the physical location

> engine uses to store generated image/chart. You have to make sure the

> image can be loaded by the url constructed from that base image url.

>

> For example in Birt viewer, we define image dir as "/report/images", base

> image url to be "/report/images" too. Also make sure the "/report/images"

> is available in your web app's doc root. This is a very simple and quick

> solution and you can develop more advanced one.

>

> Jun Zhai

>

>

"VENKATAR" <venkatar@euclid.com> wrote in message
news:85bf92fd718b656f86766c035df0ba03$1@www.eclipse.org...
> hi
> i did not fine the code how to display report with image in previous
> posts.
> could u send me code how to display a image or table or chart report in
> standalone java program
> please help me using that code i can solve my problem
>
> regards
> venkata r
>
>
Re: Unable to display BIRT chart report in JSP page [message #115828 is a reply to message #115714] Wed, 25 January 2006 09:59 Go to previous messageGo to next message
Eclipse UserFriend
hi
i did not get from that code
if possible could u send me that total program

regards
venkata r
Re: Unable to display BIRT chart report in JSP page [message #115929 is a reply to message #115828] Wed, 25 January 2006 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Please check out the sample app:
http://www.eclipse.org/birt/index.php?page=deploy/engine.htm l#jump_10

Thanks,

David

"venkatar " <venkatar@euclid.com> wrote in message
news:0f70b2494f332ca9d96a99677c2b9ade$1@www.eclipse.org...
> hi i did not get from that code if possible could u send me that total
> program
> regards
> venkata r
>
Re: Unable to display BIRT chart report in JSP page [message #116984 is a reply to message #115929] Thu, 26 January 2006 02:09 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Unable to display BIRT chart report in JSP page [message #117054 is a reply to message #116984] Thu, 26 January 2006 03:05 Go to previous message
Eclipse UserFriend
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
>
>
>
Previous Topic:Scripting issues
Next Topic:freaky attitude of the bottom-line
Goto Forum:
  


Current Time: Mon Jul 21 21:30:52 EDT 2025

Powered by FUDForum. Page generated in 0.49041 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top