title: pentaho reporting how to get field names to display as headers
body: <p>I have got a table to display through Pentaho which contains 1 month of data. The headers of the columns will be the dates. So there is going to be 31 columns. I need to set the correct date to each header of each column and it has to be automatically done by Pentaho as I cannot know which month is selected by the user. </p>
  
  <pre><code>xmlid   title         2014-03-01   2014-03-02   2014-03-03   2014-03-04 
  Gross   Doughnut      3222.91      5749.22      4926.06      4713.06
  GST     Doughnut      0.00         0.00         0.00         0.00      
  Net     Doughnut      3222.91      5749.22      4926.06      4713.06
  </code></pre>
  
  <p>I have displayed the data successfully without using the field names by enabling "Display the index columns in the Report Designer's field selectors"... in Preferences, you can refer to report elements by column position.</p>
  
  <p>However I could not find a method to display headers.</p>
  
  <pre><code>1- $(::column::1)
  
  2- String[] colNames = (String[])dataRow.getColumnNames();
  return colNames[1];
  </code></pre>
  
  <p>I have tried the methods above but did not get me anywhere.</p>
  
  <p>$(::column::1) ==> this displays the data printed NOT sql query headers.</p>
  
  <p>getColumnNames() ==> I am able to access parameters through dataRow however this method did not help either although it is told on the internet that getColumnNames() method exists under dataRow.</p>
  
  <p>PS: pivot is applied in sql server. I know crosstab exists in Pentaho but ridiculously slow. </p>
  
  <p>Any help is appreciated.
  Thank you
  Oz.</p>