Home
Analytics
How to include header.jsp?
Yufan
<p>Hi,</p><p> </p><p>We were successfully displaying the reports in the page, but the output is only has a chart in the big white page.</p><p> </p><p>How to include my "header.jsp" in to the report design file?</p><p> </p><p>1. I tried to copied my header.jsp to master page, but it does not working.</p><p> </p><p>2. Because we are using JSF, it does not recognize the <birt> tags, so use this tag also not working. (I forget birt.tld)</p><p> </p><p>3.There is a Java servlet calling BIRT api and task.run(), so I tried to check BIRT API, but there is no such methods like setJspHeader() or setJspInclude() methods... </p><p> </p><p>4.I also tried to manage do something in the JavaScript datasources, but really no idea how to inject the jsp codes into it.</p><p> </p><p>Is anyone can give me an idea to include my header.jsp in the report?</p><p> </p><p>William please help me, I am dying.</p><p> </p><p>Thanks</p><p> </p><p>Yufan</p>
Find more posts tagged with
Comments
Yufan
<p>Hi,</p><p> </p><p>This is resolved!</p><p> </p><p>1. I duplicated 1 of my jsp, change a name i.e. hello.jsp, remove unwanted things, only left those lines of importing header, footer of this jsp.</p><p> </p><p>2. birt.tld provides viewer, param and other functions servlets We only need the tag <birt:viewer> which is used to output a preview, but it is enough for a single barchart like pages.</p><p> </p><p>If I have multiple pages of report, like 10 pages revenue report. I would use a full output as PDF file, so it would be opened by foxit reader in the browser, it looks very good.</p><p> </p><p>For single page report, we just use birt.tld, <birt:report/> tag in the jsp, so I put this lines in my hello.jsp (be careful the path):</p><p> </p><div><pre class="_prettyXprint"><birt:report id="birtReport" baseURL="http://localhost:8080/Report"reportDesign="Reports/myreport.rptdesign" height="600" width="1200" format="html"></birt:report></pre></div><p>3. Finally dont forget to put these codes in your web.xml to enable the viewer servlet, if you use JSF, this is also very important:</p><pre class="_prettyXprint _lang-xml"> <servlet> <servlet-name>EngineServlet</servlet-name> <servlet-class>org.eclipse.birt.report.servlet.BirtEngineServlet</servlet-class> </servlet> </pre><p>and</p><pre class="_prettyXprint _lang-xml"> <servlet-mapping> <servlet-name>EngineServlet</servlet-name> <url-pattern>/preview</url-pattern> </servlet-mapping></pre><p>Then go to hello.jsf and I can see the output.</p><p> </p><p>It looks very beautiful, CSS3 header and footer, plus a birt barchart in the content.</p><p> </p><p>Thank you.</p>
mwilliams
Glad you got a solution. Thanks for updating the thread!