Bar Chart in Excel using Eclipse Kepler
<p>Hi Everyone,</p><p> </p><p>I have the Eclipse Kepler</p><p> Version: Kepler Service Release 1</p><div> Build id: 20130919-0819</div><div> </div><div>It contains default spudsoft emitter.</div><div> </div><div>I need to know,</div><div> </div><div>1)Am i configure the spudsoft emitter for this eclipse or not.</div><div>2)I created report with Bar chart.In preview XLS mode it will be viewed and saved.But i run the program in java application i didn't get Bar chart.</div><div> </div><div>3)I created aggregation for entire column values.I get the reult in preview mode.But i didn't get while i run the program in java application.</div><div> </div><div>Here i include,</div><div> </div><div>1)CallReprt.java-Trigger the Report in java</div><div> </div><div><div><pre class="_prettyXprint">package com.overall;import org.eclipse.birt.report.engine.api.EXCELRenderOption;import org.eclipse.birt.report.engine.api.EngineConfig;import org.eclipse.birt.report.engine.api.IExcelRenderOption;import org.eclipse.birt.report.engine.api.IReportRunnable;import org.eclipse.birt.report.engine.api.IRunAndRenderTask;import org.eclipse.birt.report.engine.api.ReportEngine;public class CallReport {CallReport() {try{ String reportsname = "Projects_t.xls";EngineConfig conf = null;ReportEngine eng = null;IReportRunnable design = null;IRunAndRenderTask task = null;String report="srcBilling.rptdesign";conf = new EngineConfig();conf.setEngineHome(" ");eng = new ReportEngine( conf );try{design = eng.openReportDesign(report); } catch (Exception e){System.out.println("An error occured during the opening of the report file!");System.out.println(e); }task = eng.createRunAndRenderTask(design); EXCELRenderOption xl=new EXCELRenderOption();xl.setOption(IExcelRenderOption.HIDE_GRIDLINES, new Boolean(true));xl.setOutputFormat("xls");String reportoutput="src/Report";xl.setOutputFileName(reportoutput+"/"+reportsname); task.setRenderOption(xl); try { task.run(); Thread.sleep(15000); } catch (Exception e) { System.out.println("An error occured while running the report!"); System.out.println(e); } System.out.println("Report Created"); eng.destroy(); }catch(Exception ex){System.out.println("44"+ex);}System.exit(0); }public static void main(String[] args) {CallReport ob=new CallReport(); }}</pre></div><div> </div></div><div> </div><div> </div><div>2)Project-list of values</div><div> </div><div><div><pre class="_prettyXprint">package com.overall;import java.util.Vector;public class Project {Vector v=new Vector();public Vector getProject() {v.add(new String[]{"1","sample1","100","200","150","270","320","420","Dec","Jan","Feb","Mar","Apr","May"});v.add(new String[]{"2","sample2","110","220","180","370","380","490","Dec","Jan","Feb","Mar","Apr","May"});v.add(new String[]{"3","sample3","120","240","130","570","320","620","Dec","Jan","Feb","Mar","Apr","May"});return v;}public static void main(String args[]) throws Exception{Project p=new Project();Vector s=p.getProject();for(int i=0;i<s.size();i++){String[] sa = (String[])s.get(i); System.out.println("sa ln:"+sa.length);System.out.println(sa[0] + "*" + sa[1] + "*" + sa[2] + "*" + sa[3] + "*" + sa[4] + "*" + sa[5] + "*" + sa[6] + "*" + sa[7] + "*" + sa[8] + "*" + sa[9] + "*" + sa[10] + "*" + sa[11] + "*" + sa[12] + "*" + sa[13]);}}}</pre></div><div> </div></div><div> </div><div>3)Billing.rptdesign-Birt file</div><div> </div><div>Here i enter the birt file in xml source format.</div><div> </div><div> </div><div><div><pre class="_prettyXprint"><?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 4.3.1.v201309091055 Build <4.3.1.v20130917-1035></property> <property name="units">in</property> <property name="iconFile">/templates/blank_report.gif</property> <property name="bidiLayoutOrientation">ltr</property> <property name="imageDPI">96</property> <data-sources> <script-data-source name="Data Source" id="7"/> </data-sources> <data-sets> <script-data-set name="Data Set" id="8"> <list-property name="resultSetHints"> <structure> <property name="position">1</property> <property name="name">projid</property> <property name="dataType">string</property> </structure> <structure> <property name="position">2</property> <property name="name">proj name</property> <property name="dataType">string</property> </structure> <structure> <property name="position">3</property> <property name="name">m1</property> <property name="dataType">string</property> </structure> <structure> <property name="position">4</property> <property name="name">m2</property> <property name="dataType">string</property> </structure> <structure> <property name="position">5</property> <property name="name">m3</property> <property name="dataType">string</property> </structure> <structure> <property name="position">6</property> <property name="name">m4</property> <property name="dataType">string</property> </structure> <structure> <property name="position">7</property> <property name="name">m5</property> <property name="dataType">string</property> </structure> <structure> <property name="position">8</property> <property name="name">m6</property> <property name="dataType">string</property> </structure> <structure> <property name="position">9</property> <property name="name">month1</property> <property name="dataType">string</property> </structure> <structure> <property name="position">10</property> <property name="name">month2</property> <property name="dataType">string</property> </structure> <structure> <property name="position">11</property> <property name="name">month3</property> <property name="dataType">string</property> </structure> <structure> <property name="position">12</property> <property name="name">month4</property> <property name="dataType">string</property> </structure> <structure> <property name="position">13</property> <property name="name">month5</property> <property name="dataType">string</property> </structure> <structure> <property name="position">14</property> <property name="name">month6</property> <property name="dataType">string</property> </structure> </list-property> <list-property name="columnHints"> <structure> <property name="columnName">projid</property> </structure> <structure> <property name="columnName">proj name</property> </structure> <structure> <property name="columnName">m1</property> </structure> <structure> <property name="columnName">m2</property> </structure> <structure> <property name="columnName">m3</property> </structure> <structure> <property name="columnName">m4</property> </structure> <structure> <property name="columnName">m5</property> </structure> <structure> <property name="columnName">m6</property> </structure> <structure> <property name="columnName">month1</property> </structure> <structure> <property name="columnName">month2</property> </structure> <structure> <property name="columnName">month3</property> </structure> <structure> <property name="columnName">month4</property> </structure> <structure> <property name="columnName">month5</property> </structure> <structure> <property name="columnName">month6</property> </structure> </list-property> <list-property name="parameters"/> <structure name="cachedMetaData"> <list-property name="resultSet"> <structure> <property name="position">1</property> <property name="name">projid</property> <property name="dataType">string</property> </structure> <structure> <property name="position">2</property> <property name="name">proj name</property> <property name="dataType">string</property> </structure> <structure> <property name="position">3</property> <property name="name">m1</property> <property name="dataType">string</property> </structure> <structure> <property name="position">4</property> <property name="name">m2</property> <property name="dataType">string</property> </structure> <structure> <property name="position">5</property> <property name="name">m3</property> <property name="dataType">string</property> </structure> <structure> <property name="position">6</property> <property name="name">m4</property> <property name="dataType">string</property> </structure> <structure> <property name="position">7</property> <property name="name">m5</property> <property name="dataType">string</property> </structure> <structure> <property name="position">8</property> <property name="name">m6</property> <property name="dataType">string</property> </structure> <structure> <property name="position">9</property> <property name="name">month1</property> <property name="dataType">string</property> </structure> <structure> <property name="position">10</property> <property name="name">month2</property> <property name="dataType">string</property> </structure> <structure> <property name="position">11</property> <property name="name">month3</property> <property name="dataType">string</property> </structure> <structure> <property name="position">12</property> <property name="name">month4</property> <property name="dataType">string</property> </structure> <structure> <property name="position">13</property> <property name="name">month5</property> <property name="dataType">string</property> </structure> <structure> <property name="position">14</property> <property name="name">month6</property> <property name="dataType">string</property> </structure> </list-property> </structure> <property name="dataSource">Data Source</property> <method name="open"><![CDATA[scheduleClass2=new Packages.com.overall.Project();schedules2=scheduleClass2.getProject();totalrows2=schedules2.size();currentrow2=0;]]></method> <method name="fetch"><![CDATA[if(currentrow2>=totalrows2){return(false);}var favrow=schedules2.get(currentrow2);var projectid = favrow[0];var projectname = favrow[1]; var m1 = favrow[2];var m2 = favrow[3];var m3 = favrow[4];var m4 = favrow[5];var m5 = favrow[6];var m6 = favrow[7];var month1 = favrow[8];var month2 = favrow[9];var month3 = favrow[10];var month4 = favrow[11];var month5 = favrow[12];var month6 = favrow[13];row["projid"] = projectid;row["proj name"] = projectname;row["m1"] = m1;row["m2"] = m2;row["m3"] = m3;row["m4"] = m4;row["m5"] = m5;row["m6"] = m6;row["month1"] = month1;row["month2"] = month2;row["month3"] = month3;row["month4"] = month4;row["month5"] = month5;row["month6"] = month6;currentrow2=currentrow2+1;return(true);]]></method> <method name="close"><![CDATA[scheduleClass=null;schedules=null;]]></method> </script-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"> <property name="type">a4</property> <property name="orientation">landscape</property> <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> <text id="9"> <property name="contentType">html</property> <text-property name="content"><![CDATA[<H3><CENTER><B>REPORT<CENTER></B></H3>]]></text-property> </text> <table id="236"> <property name="width">10.083333333333334in</property> <property name="dataSet">Data Set</property> <list-property name="boundDataColumns"> <structure> <property name="name">projid</property> <text-property name="displayName">projid</text-property> <expression name="expression" type="javascript">dataSetRow["projid"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">proj name</property> <text-property name="displayName">proj name</text-property> <expression name="expression" type="javascript">dataSetRow["proj name"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">m1</property> <text-property name="displayName">m1</text-property> <expression name="expression" type="javascript">dataSetRow["m1"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">m2</property> <text-property name="displayName">m2</text-property> <expression name="expression" type="javascript">dataSetRow["m2"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">m3</property> <text-property name="displayName">m3</text-property> <expression name="expression" type="javascript">dataSetRow["m3"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">m4</property> <text-property name="displayName">m4</text-property> <expression name="expression" type="javascript">dataSetRow["m4"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">m5</property> <text-property name="displayName">m5</text-property> <expression name="expression" type="javascript">dataSetRow["m5"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">m6</property> <text-property name="displayName">m6</text-property> <expression name="expression" type="javascript">dataSetRow["m6"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">month1</property> <text-property name="displayName">month1</text-property> <expression name="expression" type="javascript">dataSetRow["month1"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">month2</property> <text-property name="displayName">month2</text-property> <expression name="expression" type="javascript">dataSetRow["month2"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">month3</property> <text-property name="displayName">month3</text-property> <expression name="expression" type="javascript">dataSetRow["month3"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">month4</property> <text-property name="displayName">month4</text-property> <expression name="expression" type="javascript">dataSetRow["month4"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">month5</property> <text-property name="displayName">month5</text-property> <expression name="expression" type="javascript">dataSetRow["month5"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">month6</property> <text-property name="displayName">month6</text-property> <expression name="expression" type="javascript">dataSetRow["month6"]</expression> <property name="dataType">string</property> </structure> <structure> <property name="name">Column Binding_6</property> <expression name="expression" type="javascript">BirtStr.toUpper(row["proj name"])</expression> <property name="dataType">string</property> <property name="allowExport">true</property> </structure> <structure> <property name="name">Aggregation</property> <property name="dataType">float</property> <property name="aggregateFunction">SUM</property> <list-property name="arguments"> <structure> <property name="name">Expression</property> <expression name="value" type="javascript">row["m1"]</expression> </structure> </list-property> <property name="allowExport">true</property> </structure> <structure> <property name="name">Aggregation_1</property> <property name="dataType">float</property> <property name="aggregateFunction">SUM</property> <list-property name="arguments"> <structure> <property name="name">Expression</property> <expression name="value" type="javascript">row["m2"]</expression> </structure> </list-property> <property name="allowExport">true</property> </structure> <structure> <property name="name">Aggregation_2</property> <property name="dataType">float</property> <property name="aggregateFunction">SUM</property> <list-property name="arguments"> <structure> <property name="name">Expression</property> <expression name="value" type="javascript">row["m3"]</expression> </structure> </list-property> <property name="allowExport">true</property> </structure> <structure> <property name="name">Aggregation_3</property> <property name="dataType">float</property> <property name="aggregateFunction">SUM</property> <list-property name="arguments"> <structure> <property name="name">Expression</property> <expression name="value" type="javascript">row["m4"]</expression> </structure> </list-property> <property name="allowExport">true</property> </structure> <structure> <property name="name">Aggregation_4</property> <property name="dataType">float</property> <property name="aggregateFunction">SUM</property> <list-property name="arguments"> <structure> <property name="name">Expression</property> <expression name="value" type="javascript">row["m5"]</expression> </structure> </list-property> <property name="allowExport">true</property> </structure> <structure> <property name="name">Aggregation_5</property> <property name="dataType">float</property> <property name="aggregateFunction">SUM</property> <list-property name="arguments"> <structure> <property name="name">Expression</property> <expression name="value" type="javascript">row["m6"]</expression> </structure> </list-property> <property name="allowExport">true</property> </structure> </list-property> <column id="310"> <property name="width">0.9375in</property> </column> <column id="311"> <property name="width">2.71875in</property> </column> <column id="312"> <property name="width">1.0416666666666667in</property> </column> <column id="313"> <property name="width">0.9166666666666666in</property> </column> <column id="314"> <property name="width">0.9791666666666666in</property> </column> <column id="315"> <property name="width">1.15625in</property> </column> <column id="316"> <property name="width">1.3125in</property> </column> <column id="317"> <property name="width">1.0208333333333333in</property> </column> <header> <row id="237"> <property name="fontWeight">bold</property> <property name="verticalAlign">middle</property> <property name="height">0.375in</property> <cell id="238"> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1px</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1px</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1px</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1px</property> <property name="whiteSpace">pre</property> <label id="239"> <text-property name="text">Job Number</text-property> </label> </cell> <cell id="240"> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1px</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1px</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1px</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1px</property> <property name="whiteSpace">pre</property> <label id="241"> <text-property name="text">Job Name</text-property> </label> </cell> <cell id="242"> <property name="backgroundColor">#C9BAC1</property> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1px</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1px</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1px</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1px</property> <property name="whiteSpace">pre</property> <data id="284"> <property name="resultSetColumn">month1</property> </data> </cell> <cell id="244"> <property name="backgroundColor">#CEC7E0</property> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1px</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1px</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1px</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1px</property> <property name="whiteSpace">pre</property> <data id="286"> <property name="resultSetColumn">month2</property> </data> </cell> <cell id="246"> <property name="backgroundColor">#8EA5DF</property> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1px</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1px</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1px</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1px</property> <property name="whiteSpace">pre</property> <data id="288"> <property name="resultSetColumn">month3</property> </data> </cell> <cell id="248"> <property name="backgroundColor">#BEE9D0</property> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1px</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1px</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1px</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1px</property> <property name="whiteSpace">pre</property> <data id="290"> <property name="resultSetColumn">month4</property> </data> </cell> <cell id="250"> <property name="backgroundColor">#FCE2F3</property> <property name="borderBottomStyle">solid</property> <property name="borderBottomWidth">1px</property> <property name="borderLeftStyle">solid</property> <property name="borderLeftWidth">1px</property> <property name="borderRightStyle">solid</property> <property name="borderRightWidth">1px</property> <property name="borderTopStyle">solid</property> <property name="borderTopWidth">1px</property> <property name="whiteSpace">pre</property>