开发者

BIRT WebViewerExample - default location of report design

开发者 https://www.devze.com 2023-01-16 08:07 出处:网络
Per the BIRT documentation link text the default location should be under report folder. However, all samples have the report designs at the root. What is the recommended location for report designs,

Per the BIRT documentation link text

the default location should be under report folder. However, all samples have the report designs at the root. What is the recommended location for report designs, images, css, js files?

Also, do I need to modify web.xml (I guessing, yes) if I put report design开发者_高级运维s in /report

TIA


Correct - you need to set the BIRT_VIEWER_DOCUMENT_FOLDER parameter in the web.xml:

<!--
    Temporary document files directory. Defaults to ${birt home}/documents
-->
<context-param>
    <param-name>BIRT_VIEWER_DOCUMENT_FOLDER</param-name>
    <param-value></param-value>
</context-param>

Then you can access the report as:

http://localhost:8080/birtviewer/frameset?__report=report.rptdesign

You can check out these for more information on how to configure it:

http://www.scribd.com/doc/2685254/Installing-the-BIRT-Viewer-in-Tomcat-and-jboss


Premised, the comments with ~600 chars was too short for my answer: I just tried to find out to separate my BIRT reports from the webapp folder, which took a good hour due to insufficient rights. I hope it'll save others from fathom a solution, too.

In the <param-value> section you can use a fully qualified name of the directory, where you'd like to point BIRT to access the design file. Also please make sure, that your Servlet container may access that specific folder.

From the Birt Docs you may see, that you should edit the section where BIRT_VIEWER_WORKING_FOLDER equals true. Because of the following explanation:

This is the default location for report designs. If the report design specified in a URL parameter is relative, this path is pre-pended to the report name.

As an example I put reports of different website projects each into a separate folder, in this example they're located in teh webserver's home location.

    <!--
            Report resources directory for preview. Defaults to ${birt home}
    -->
    <context-param>
            <param-name>BIRT_VIEWER_WORKING_FOLDER</param-name>
            <param-value>/var/www/html/reports</param-value>
    </context-param>

    <!--
            Temporary document files directory. Defaults to ${birt home}/documents
    -->
    <context-param>
            <param-name>BIRT_VIEWER_DOCUMENT_FOLDER</param-name>
            <param-value>/var/www/html/reports</param-value>
    </context-param>

Above you can see a snippet of my web.xml regarding the birt webapp. To call a report in a subfolder, e.g. "totalreport", the URL would be accessible via:

http://localhost:8080/birt/frameset?__report=totalreport/My_report.rptdesign&itemID=1000

I hope this helps anyone a bit.

0

精彩评论

暂无评论...
验证码 换一张
取 消