Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Linux birtviewer error on flat file: invalid table name
Arif shah
<p>Hi,</p>
<p> </p>
<p>I have developed a report that is using a flat file for some parameter values. It runs fine in birt designer but when I run it on birtviewer in linux environment, I get the below error</p>
<pre class="_prettyXprint">
Table (id = 4172):
+ An exception occurred during processing. Please see the following message for details:
Failed to prepare the query execution for the data set: distinct qmid
Failed to prepare the following query for the data set type (org.eclipse.datatools.connectivity.oda.flatfile.dataSet).
[select "qmid" from "qmids.csv" : {"qmid","qmid",INT}]
org.eclipse.datatools.connectivity.oda.flatfile.InvalidResourceException: Invalid table name:qmids.csv</pre>
<p>Can someone please guide what is this error about and how to fix it</p>
<p> </p>
<p>Regards</p>
<p>Arif</p>
Find more posts tagged with
Comments
Clement Wong
<p>In the report design, is the path to the CSV, a relative or absolute path? What is the path value?</p>
<p> </p>
<p>Where is qmids.csv located when run from the Designer?</p>
<p> </p>
<p>Where is qmids.csv located in the BIRT Viewer on Linux?</p>
<p> </p>
<p>What is <span>the value of BIRT_VIEWER_WORKING_FOLDER in the BIRT Viewer's web.xml?</span></p>
<p>What is <span>the value of BIRT_RESOURCE_PATH in the BIRT Viewer's web.xml?</span></p>
Arif shah
<p>Hi Clement,</p>
<p> </p>
<p>Many thanks for your answers. Actually your hint about the absolute path helped me. I installed birtviewer on my windows and checked if it worked or not. What I found was that relative path does not work in birt viewer. I have to change the path to absolute like C:\tomcat\webapp\Birt\CSV and then it works. A relative path does not work in birt viewer</p>
<p> </p>
<p>Also, If in my designer, I want to put the absolute path of linux /var/lib/tomcat8/webapps/birt/CSV, the designer does not recognize the path and does not let me change to this path</p>
<p> </p>
<p>My two questions</p>
<p> </p>
<p>1) If I want to put the linux absolute path to csv data source in my designer, how can i do that when my designer is installed on my windows machine</p>
<p> </p>
<p>2) How can I use the relative path if I want to use flat file data source</p>
<p> </p>
<p>Regards</p>
<p>Arif</p>
Clement Wong
<p>Let's assume that you have not set your BIRT home (set via <span>BIRT_VIEWER_WORKING_FOLDER in web.xml) so it's C:\Tomcat\webapp\birt or /bin/tomcat/webapp/birt.</span></p>
<p> </p>
<p><span>In your report design, you can use Relative path, but for the BIRT Engine, you should consider the following suggestion in this older thread
@<
;/span> <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/18664-using-my-report-files-with-tomcat-and-birt-viewer/?p=61051'>http://developer.actuate.com/community/forum/index.php?/topic/18664-using-my-report-files-with-tomcat-and-birt-viewer/?p=61051</a></p>
;
<p> </p>
<p>The following worked for me in Tomcat 8, BIRT Engine 4.5 on a Windows environment with a report design having a relative path for the Data Source. This code was added into the beforeOpen of the Data Source.</p>
<pre class="_prettyXprint">
if (reportContext.getHttpServletRequest().getAttribute("attributeBean").isDesigner() ) {
//we are in the designer do not change anything
}
else {
var rp = reportContext.getHttpServletRequest().getSession().getServletContext().getRealPath("/data");
// assume you have added a data directory under the BIRT webapp
if( rp == null ) {
//cant find csv directory
}
else {
this.setExtensionProperty("HOME", rp);
//or set the path to any location you want
}
}</pre>
<p>
And if you want to improve on the suggestion in the older post, we can change Line 5 so that it picks up the value in the UI via this.getExtensionProperty("HOME"), and no hardcoding of the path is needed in the beforeOpen.</p>
<pre class="_prettyXprint">
var rp = reportContext.getHttpServletRequest().getSession().getServletContext().getRealPath(this.getExtensionProperty("HOME").substring(0,this.getExtensionProperty("HOME").length()-1));
</pre>
<p>Both variations worked for me.</p>