Home
Analytics
How to run the report that was created using a csv file in the report viewer of Apache Tomcat server
Aneesh V S
<p>Hi,</p><p> </p><p>I have created a simple report design using flat file as the datasource (csv file) in BIRT report designer, the report runs fine in Report designer but when running in Report viewer in Tomcat, I am not able to view the report.</p><p> </p><p>These are the steps I followed :</p><p> </p><p>1) created a .rptdesign file in Eclipse Open Source BIRT Designer using a csv file</p><p>2) Copied the same .rptdesign file under webapps/WebViewer folder of Apache Tomcat server.</p><p> </p><p>Do not know where to place the csv source file in the Tomcat server.</p><p> </p><p>However, I was able to run the sample reports like test1, test2 provided under the WebViewer folder. I checked the datasource for these reports and found that these reports have the sample database as the source and I could not get much help as to how to run the reports that are created using a csv file.</p><p> </p><p>Could anyone help?</p><p> </p><p> </p><p> </p><p> </p>
Find more posts tagged with
Comments
mwilliams
If you had the csv file in the root of your project, I believe you should place the file in the root folder of the web viewer with the report. What is your BIRT version? I'll set up an example.
Aneesh V S
<p>Hi Michael,
Thank you for your quick response, I am uisng BIRT 4.3.2 version, It would be of great help, if you can show me an example of placing this sample source file (CSV) in the root and run the report in WebViewer.
</p>
mwilliams
Drop both of these into the root of your BIRT Sample Viewer installation, with the test.rptdesign that comes with it. The report can go in a different folder, you just need to make sure you define the path in the URL.
Aneesh V S
<p>Michael,</p><p> </p><p>Thanks for the sample reports, I tried putting these report and source file in the root and it did worked, but however I tried creating a report with charts like bar chart and pie charts with the csv files and placed the report design and the source file in the root, for some reason its displaying blank values.</p><p> </p><p>I tried creating another report similar to the one which you provided, like a table or so, it worked . its only when I try to create charts, I am getting blank reports.</p><p> </p><p>Unfortunately, I am not able to upload those attachments as I don't see any option to attach the csv and rptdesign files.</p><p> </p><p>Please help.</p><p> </p><p> </p><p> </p><p>I compared the source code for both the .rptdesign and do not see much difference. Attaching is the source code.</p><pre class="_prettyXprint _lang-html"><?xml version="1.0" encoding="UTF-8"?><report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1"> <property name="createdBy">Eclipse BIRT Designer Version 3.7.2.v20121022-1705 Build <3.7.2.v20121022-1705></property> <property name="units">in</property> <property name="iconFile">/templates/blank_report.gif</property> <property name="bidiLayoutOrientation">ltr</property> <property name="imageDPI">96</property> <list-property name="libraries"> <structure> <property name="fileName">/ThemesReportItems.rptlibrary</property> <property name="namespace">ThemesReportItems</property> </structure> </list-property> <data-sources> <oda-data-source extensionID="org.eclipse.datatools.connectivity.oda.flatfile" name="Data Source" id="7"> <property name="URI">POC.csv</property> <property name="DELIMTYPE">COMMA</property> <property name="CHARSET">UTF-8</property> <property name="INCLCOLUMNNAME">YES</property> <property name="INCLTYPELINE">NO</property> <property name="TRAILNULLCOLS">NO</property> </oda-data-source> </data-sources> <data-sets> <oda-data-set extensionID="org.eclipse.datatools.connectivity.oda.flatfile.dataSet" name="Data Set" id="8"> <list-property name="columnHints"> <structure> <property name="columnName">Department</property> <property name="analysis">dimension</property> <text-property name="heading">Department</text-property> </structure> <structure> <property name="columnName">Expense</property> <property name="analysis">measure</property> <text-property name="heading">Expense</text-property> </structure> </list-property> <structure name="cachedMetaData"> <list-property name="resultSet"> <structure> <property name="position">1</property> <property name="name">Department</property> <property name="dataType">string</property> </structure> <structure> <property name="position">2</property> <property name="name">Expense</property> <property name="dataType">float</property> </structure> </list-property> </structure> <property name="dataSource">Data Source</property> <list-property name="resultSet"> <structure> <property name="position">1</property> <property name="name">Department</property> <property name="nativeName">Department</property> <property name="dataType">string</property> <property name="nativeDataType">12</property> </structure> <structure> <property name="position">2</property> <property name="name">Expense</property> <property name="nativeName">Expense</property> <property name="dataType">float</property> <property name="nativeDataType">12</property> </structure> </list-property> <xml-property name="queryText"><![CDATA[select "Department", "Expense" from "POC.csv" : {"Department","Department",STRING;"Expense","Expense",DOUBLE}]]></xml-property> <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?><model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel"> <Version>2.0</Version> <design:ResultSets derivedMetaData="true"> <design:resultSetDefinitions> <design:resultSetColumns> <design:resultColumnDefinitions> <design:attributes> <design:identifier> <design:name>Department</design:name> <design:position>1</design:position> </design:identifier> <design:nativeDataTypeCode>12</design:nativeDataTypeCode> <design:precision>-1</design:precision> <design:scale>-1</design:scale> <design:nullability>Unknown</design:nullability> </design:attributes> <design:usageHints> <design:label>Department</design:label> <design:formattingHints/> </design:usageHints> </design:resultColumnDefinitions> <design:resultColumnDefinitions> <design:attributes> <design:identifier> <design:name>Expense</design:name> <design:position>2</design:position> </design:identifier> <design:nativeDataTypeCode>12</design:nativeDataTypeCode> <design:precision>-1</design:precision> <design:scale>-1</design:scale> <design:nullability>Unknown</design:nullability> </design:attributes> <design:usageHints> <design:label>Expense</design:label> <design:formattingHints/> </design:usageHints> </design:resultColumnDefinitions> </design:resultSetColumns> <design:criteria/> </design:resultSetDefinitions> </design:ResultSets></model:DesignValues>]]></xml-property> </oda-data-set> </data-sets> <styles> <style name="report" id="4"> <property name="fontFamily">sans-serif</property> <property name="fontSize">10pt</property> </style> <style name="crosstab-cell" id="5"> <property name="borderBottomColor">#CCCCCC</property> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1pt</property> <property name="borderLeftColor">#CCCCCC</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1pt</property> <property name="borderRightColor">#CCCCCC</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1pt</property> <property name="borderTopColor">#CCCCCC</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1pt</property> </style> <style name="crosstab" id="6"> <property name="borderBottomColor">#CCCCCC</property> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1pt</property> <property name="borderLeftColor">#CCCCCC</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1pt</property> <property name="borderRightColor">#CCCCCC</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1pt</property> <property name="borderTopColor">#CCCCCC</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1pt</property> </style> </styles> <page-setup> <simple-master-page name="Simple MasterPage" id="2"> <page-footer> <text id="3"> <property name="contentType">html</property> <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property> </text> </page-footer> </simple-master-page> </page-setup> <body> <extended-item extensionName="Chart" id="9"> <xml-property name="xmlRepresentation"><![CDATA[<ActuateChart version="2.5.3"> <ChartWithoutAxes version="2.5.3" type="Pie Chart" subType="Standard"> <block> <children _type="TitleBlock"> <outline> <color _nil="1"/> </outline> <label> <background _nil="1"/> <outline> <color _nil="1"/> </outline> </label> </children> <children _type="Plot"> <outline> <color _nil="1"/> </outline> <clientArea> <outline> <color _nil="1"/> </outline> </clientArea> </children> <children _type="Legend" itemType="1"> <outline> <color _nil="1"/> </outline> <clientArea> <outline> <color _nil="1"/> </outline> </clientArea> <separator> <color _nil="1"/> </separator> <title> <background _nil="1"/> <outline> <color _nil="1"/> </outline> </title> </children> <bounds _body="0.0,0.0,212.0,130.0"/> <outline> <color _nil="1"/> </outline> </block> <extendedProperties name="enable.area.alt" value="false"/> <extendedProperties name="enable.drill.category" value="true"/> <extendedProperties name="enable.drill.series" value="true"/> <sampleData> <baseSampleData dataSetRepresentation="'A','B','C','D','E'"/> <orthogonalSampleData dataSetRepresentation="6,4,12,8,10" seriesDefinitionIndex="0"/> </sampleData> <emptyMessage> <caption value="This chart contains no data."/> <background _body=",64,127,127,127"/> <outline> <color _body=",128,127,127,127"/> </outline> </emptyMessage> <seriesDefinitions> <query definition=""/> <seriesDefinitions> <query definition=""/> <seriesPalette/> <series _type="PieSeries" seriesIdentifier="Series 1"> <label> <background _nil="1"/> <outline> <color _nil="1"/> </outline> </label> <dataDefinition definition="row["Expense"]"> <grouping/> </dataDefinition> <dataPoint separator=", "> <components type="1"/> </dataPoint> <triggers condition="6"> <action type="1"> <value _type="TooltipValue" text="" delay="200"/> </action> </triggers> <title> <background _nil="1"/> <outline> <color _nil="1"/> </outline> </title> </series> <grouping/> </seriesDefinitions> <series seriesIdentifier=""> <label> <background _nil="1"/> <outline> <color _nil="1"/> </outline> </label> <dataDefinition definition="row["Department"]"/> <dataPoint separator=", "> <components type="1"/> </dataPoint> <curveFitting _nil="1"/> </series> <grouping enabled="true"/> </seriesDefinitions> </ChartWithoutAxes></ActuateChart>]]></xml-property> <property name="outputFormat">JS</property> <property name="inheritColumns">true</property> <property name="dataSet">Data Set</property> <property name="height">3.5729166666666665in</property> <property name="width">5.697916666666667in</property> <list-property name="boundDataColumns"> <structure> <property name="name">Department</property> <expression name="expression" type="javascript">dataSetRow["Department"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">Expense</property> <expression name="expression" type="javascript">dataSetRow["Expense"]</expression> <property name="dataType">float</property> </structure> </list-property> <property name="theme">ThemesReportItems.default-chart</property> </extended-item> </body></report></pre>
mwilliams
I just added a chart to my report that I attached above and it works as expected.
If you can attach a csv file and rptdesign that shows your issue in a zip file, I'll take a look. You attach items by clicking on the "More Reply Options" button below the quick reply window. It'll open a full editor.
Aneesh V S
<p>Michael,</p><p> </p><p>Thanks a lot for your guidance and follow up, I was able to run the reports with charts as well
.</p><p> </p><p>I guess, the issue must be with the Versioning of the report.</p><p> </p><p> </p><p>The report that ran fine was using the version 4.3.1</p><p> </p><p><property name="createdBy">Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130917-1035></property></p><p> </p><p>The report that broke was using the version</p><p> </p><p> <property name="createdBy">Eclipse BIRT Designer Version 3.7.2.v20121022-1705 Build <3.7.2.v20121022-1705></property></p>
mwilliams
<p>Great! Glad to hear it's working for you now. Let me know if you run into any other issues.</p>