Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-report-designer-dev] BIRT report is diplayed as XML on JSP instead of HTML

Hi!

I am new to BIRT and facing this issue I am unable to resolve.

On Eclipse, when I run the BIRT report only, I get it in HTML format. 

However, my aplication requires that when a user selects a report type, a
form is submitted to  birtReport.jsp page where there is a business logic
that decides which of the many reports is going to be loaded into the body
of the JSP page. 

Below is the code of birtReport.jsp I wrote :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<%@taglib uri="/WEB-INF/tlds/birt.tld" prefix="birt"%>
<%@page contentType="text/html;charset=windows-1252"%>


<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"/>
    <title>report1</title>
    
    <%
        String routeId = request.getParameter("rtId");
        String schoolId = request.getParameter("scId");   
        
         /*Comment....the business logic to decide which report to load lies
here...now say the report to be loaded is "report1.rptDesign"*/

         String reportName = "report1.rptdesign";
    %>
    
    
  </head>
  <body>
  	Report name: <%= reportName %>
  	<birt:viewer id="v1" reportDesign="<%= reportName %>" height="500"
width="800">
                <birt:param name="scId" value="<%=schoolId%>"></birt:param>
		<birt:param name="rtId" value="<%=routeId%>"></birt:param>
        </birt:viewer>	  	
  </body>
</html>


Now, for this I've done the following:

1. Downloaded 
    a. eclipse-reporting-galileo-SR1-win32.zip (Actuate) from
[url=http://www.eclipse.org/downloads/]Eclipse Downloads[/url]
    b. Downloaded birt-runtime-2_3_2 and installed both

2. Create a Dynamic Web project and added BIRT support to it.

3. Copied the 
    a. coreapi.jar
    b. viewservlets.jar
    c. axis.jar
    d. axis-ant.jar
    e. com.ibm.icu_3.8.1.v20080530.jar
    f. engineapi.jar
    g. xercesImpl.jar
    h. xercesSamples.jar
    i. xmlParserAPIs.jar

JAR files on C:\apache-tomcat-5.5.28\common\lib folder

4. Copied birt.tld to workspace\nsReports\WebContent\WEB-INF\tlds

5. Added the following lines to web.xml file in
workspace\nsReports\WebContent\WEB-INF

<jsp-config>
	<taglib>
		<taglib-uri>/birt.tld</taglib-uri>
		<taglib-location>/WEB-INF/tlds/birt.tld</taglib-location>
        </taglib>
</jsp-config> 

6. Included the above JAR files to project Java Build Path


The report that is loaded into the JSP page is in XML format like below:

-<report version="3.2.20" id="1">
-
<property name="createdBy">
Eclipse BIRT Designer Version 2.5.1.v20090903 Build <2.5.1.v20090917-1447>
</property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
-
<parameters>
-
<scalar-parameter name="rtId" id="78">
<property name="valueType">static</property>
<property name="dataType">string</property>
<property name="distinct">true</property>
<property name="paramType">simple</property>
<property name="controlType">text-box</property>
-
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
-
<scalar-parameter name="scId" id="79">
<property name="valueType">static</property>
<property name="dataType">integer</property>
<property name="distinct">true</property>
-

and so on. How do I resolve this problem and show the HTML report on the
JSP? If anybody has an idea, please, reply. 

Thanks in advance.


P.S.: I've also tried using frameset like below in birtReport.jsp:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<%@taglib uri="/WEB-INF/tlds/birt.tld" prefix="birt"%>
<%@page contentType="text/html;charset=windows-1252"%>


<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"/>
    <title>report1</title>
    
    <%
        String routeId = request.getParameter("rtId");
        String schoolId = request.getParameter("scId");   
        
         /*Comment....the business logic to decide which report to load lies
here...now say the report to be loaded is "report1.rptDesign"*/

         String reportName = "report1.rptdesign";
    %>
    
    
  </head>
  <FRAMESET frameborder="yes" BORDER="1">
  	<FRAME NAME="osReport" SCROLLING="yes" MARGINHEIGHT="0" MARGINWIDTH="0"
NORESIZE src="overSpeed.rptdesign">
 		<birt:viewer id="report1" width="760" height="400" format="html"
reportDesign="overSpeed.rptdesign">
			<birt:param name="scId" value="<%=schoolId%>"></birt:param>
			<birt:param name="rtId" value="<%=routeId%>"></birt:param>
		</birt:viewer> 	
  	<NOFRAMES> 
  		<body>Sorry, your browser does not handle frames!</body>  		
	</NOFRAMES>
  </FRAMESET>
</html>



and simple <birt:report> tag like this in birtReport.jsp:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<%@taglib uri="/WEB-INF/tlds/birt.tld" prefix="birt"%>
<%@page contentType="text/html;charset=windows-1252"%>


<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"/>
    <title>report1</title>
    
    <%
        String routeId = request.getParameter("rtId");
        String schoolId = request.getParameter("scId");   
        
        /*Comment....the business logic to decide which report to load lies
here...now say the report to be loaded is "report1.rptDesign"*/

         String reportName = "report1.rptdesign";
    %>
    
    
  </head>
  <body>
  	Report name: <%= reportName %>
  	<birt:report id="v1" reportDesign="<%= reportName %>" height="500"
width="800"></birt:report>	  	
  </body>
</html>


None of the above worked. Please, help.
-- 
View this message in context: http://old.nabble.com/BIRT-report-is-diplayed-as-XML-on-JSP-instead-of-HTML-tp26825342p26825342.html
Sent from the Eclipse BIRT - Report Designer - Dev mailing list archive at Nabble.com.



Back to the top