Home
Analytics
Using library master page with Birt Report Viewer
svyates
I'm using Tomcat and the Birt Report Viewer. My report opens fine, but it displays only the report data. The master page that I see in the Eclipse designer and when I run the report in web viewer from the designer, does not appear when I run the report through the Web Birt Viewer. How do I get the report to use the master page when running with Tomcat?
Thanks!
Find more posts tagged with
Comments
mwilliams
Did you deploy the report library as well? Or just the report?
svyates
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="111941" data-time="1354252546" data-date="29 November 2012 - 10:15 PM"><p>
Did you deploy the report library as well? Or just the report?<br /></p></blockquote>
svyates
Just the report. I wondered if that was the problem. Do I just copy the library to the same directory as the report?
Thanks!
mwilliams
Yeah. Including your library in the same relation to the report design as you have it in your workspace should do it. If you, for instance, had a libraries folder, in your workspace, you'd probably need to create this in your deployment too, to give it the same relative path. Let me know if you have issues.
svyates
Thanks for your help! Working fine now!
mwilliams
Great to hear! Let us know whenever you have questions!
pgrie
<p>Hello
</p>
<p> </p>
<p>I have the same problem today (with the 4.4.1 version). I show the masterpage from my library <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> in the Eclipse designer but when I run </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">the report into my jsp with the birt:viewer tag don't see the masterpage.</span></p>
<p> </p>
<p><span>I add a context-param into my web.xml :</span></p>
<p> </p>
<p><context-param></p>
<div><param-name>BIRT_RESOURCE_PATH</param-name></div>
<div><param-value>/webapp/report/</param-value></div>
<div></context-param></div>
<div> </div>
<div>but it changed nothing...</div>
<div> </div>
<div>Do you have any idea ?</div>
<div> </div>
<div>Thanks</div>
mwilliams
<p>You shouldn't have to change the web.xml to get it to work. The problem is probably in the structure of your design environment vs your deployment environment. In your designer, is the library in the root folder of the BIRT project? Or is it in another folder? Could you attach your design?</p>
pgrie
<p>Hello</p>
<p> </p>
<p>Thanks for your reply</p>
<p> </p>
<p>The library is in the report folder (maf_library.rptlibrary).</p>
<p>I attached a screenshot of the architecture of my projet and my report. I can't attach my library (I'm not permitted to upload this kind of file).</p>
<div> </div>
<div> </div>
<div>Paul</div>
pgrie
<p>I found this error in the birt logs :</p>
<p> </p>
<div>févr. 20, 2015 8:29:30 AM org.eclipse.birt.report.model.core.LayoutModule loadLibrarySilently</div>
<div>AVERTISSEMENT: Syntax error found, and see error details.</div>
<div>Error.DesignFileException.SYNTAX_ERROR - 1 errors found! </div>
<div>1.) org.eclipse.birt.report.model.parser.DesignParserException (code = Error.DesignParserException.FILE_NOT_FOUND, message : The file "src/main/webapp/report/maf_library.rptlibrary" is not found.)</div>
<div> </div>
<div>It didn't found the library. </div>
<div>The path is right when i use Eclipse, but when the application is deploying on Tomcat, I think the real path must be "report/maf_library.rptlibrary" (without src/main/webapp/), no ?</div>
<div> </div>
<div>Paul</div>
pgrie
<p>I found this lines in my report :</p>
<p> </p>
<div><list-property name="libraries"></div>
<div> <structure></div>
<div> <property name="fileName"><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">src/main/webapp/report/maf_library.rptlibrary</span></property></div>
<div> <property name="namespace">maf_library</property></div>
<div> </structure></div>
<div> </list-property></div>
<div> </div>
<div>I change :</div>
<div><property name="fileName"><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">src/main/webapp/report/maf_library.rptlibrary</span></property></div>
<div> </div>
<div>by </div>
<div><property name="fileName"><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">../maf_library.rptlibrary</span></property></div>
<div> </div>
<div>And now it works on eclipse and with tomcat
</div>
<div> </div>
<div>Thanks for your help</div>
<div> </div>
<div>Paul</div>
pgrie
<p>I have another question,</p>
<p> </p>
<p>I had my data source into my library and I created two Connection Profile.</p>
<p> </p>
<p>How can I load one of the two Connection Profile into my library according to a Java Constant in my project ?</p>
<p> </p>
<p>Thanks</p>
<p> </p>
<p>Paul</p>
mwilliams
Is the value something you could pass through a parameter? Then, you could use the parameter to determine the profile?
pgrie
<p>I think I can do that.</p>
<p> </p>
<p>So if i passed the value into a parameter, I can change the connection profile with a berofe open script on my data source ? </p>
pgrie
<p>I do that but it didn't work :</p>
<p> </p>
<div>extensionProperties.OdaConnProfileStorePath = new String ("src/main/resources/birtConfJDBC/test.cps"); </div>
pgrie
<p>I clean the value odaDriverClass, odaURL, odaPassword, odaUser and OdaConnProfileStorePath into my xml file :</p>
<p> </p>
<div><data-sources></div>
<div> <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="BirtReporting" id="5"></div>
<div> <method name="beforeOpen"><![CDATA[this.setExtensionProperty("OdaConnProfileStorePath", "src/main/resources/birtConfJDBC/test.cps");]]></method></div>
<div> <list-property name="privateDriverProperties"></div>
<div> <ex-property></div>
<div> <name>metadataBidiFormatStr</name></div>
<div> <value>ILYNN</value></div>
<div> </ex-property></div>
<div> <ex-property></div>
<div> <name>disabledMetadataBidiFormatStr</name></div>
<div> </ex-property></div>
<div> <ex-property></div>
<div> <name>contentBidiFormatStr</name></div>
<div> <value>ILYNN</value></div>
<div> </ex-property></div>
<div> <ex-property></div>
<div> <name>disabledContentBidiFormatStr</name></div>
<div> </ex-property></div>
<div> </list-property></div>
<div> <property name="odaDriverClass"></property></div>
<div> <property name="odaURL"></property></div>
<div> <property name="odaUser"></property></div>
<div> <encrypted-property name="odaPassword" encryptionID="base64"></encrypted-property></div>
<div> <property name="OdaConnProfileName">Data Source</property></div>
<div> <property name="OdaConnProfileStorePath"></property></div>
<div> </oda-data-source></div>
<div> </data-sources></div>
<div> </div>
<div> </div>
<div>And this is my src/main/resources/birtConfJDBC/test.cps file :</div>
<div> </div>
<div>
<div><?xml version="1.0" encoding="UTF-8" standalone="no"?></div>
<div><DataTools.ServerProfiles version="1.0"></div>
<div><profile autoconnect="No" desc="" id="13c1d520-b8e1-11e4-aef8-84b096265316" name="Data Source" providerID="org.eclipse.birt.report.data.oda.jdbc"></div>
<div><baseproperties></div>
<div><property name="odaURL" value="jdbc:oracle:thin:
@test
:1501:testBirt"/></div>
<div><property name="odaDriverClass" value="oracle.jdbc.OracleDriver"/></div>
<div><property name="odaPassword" value="root"/></div>
<div><property name="odaUser" value="root"/></div>
<div></baseproperties></div>
<div></profile></div>
<div></DataTools.ServerProfiles></div>
</div>
mwilliams
Did you try using the expression builders in the property binding tab of the data source editor to set the values?
pgrie
<p>No.</p>
<p>I thought that if I set my connection profile in a <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">berofe open script, the values of the JDBC params (like Url, Password and user) will be </span>automatically reloaded.</p>
mwilliams
Did you ever try the property binding expression builders? Or are you only wanting to do this from the beforeOpen? Let me know. I'll set up a test of my own.