Skip to main content



      Home
Home » Archived » BIRT » Birt Report - looping through datasource in javascript(Birt Report - looping through datasource in javascript)
Birt Report - looping through datasource in javascript [message #1792495] Wed, 18 July 2018 13:48
Eclipse UserFriend
I'm trying to use Google charts in my Birt report. I have added a text and set it to display as html. Now I need to loop through the data set or data cube and to create an array like in var data. I'm just not sure how to do that or if that is the right way to do it. I have tried to look for a foreach looping through a data set or cube but have not found any. I have bound the data set to the text. I have also included the report and the csv data file.

Thanks for your help.

google.charts.load('current', {packages: ['corechart', 'bar']});
google.charts.setOnLoadCallback(drawBasic);

function drawBasic() {

      var data = google.visualization.arrayToDataTable([
        ['City', '2010 Population',],
        ['New York City, NY', 8175000],
        ['Los Angeles, CA', 3792000],
        ['Chicago, IL', 2695000],
        ['Houston, TX', 2099000],
        ['Philadelphia, PA', 1526000]
      ]);

      var options = {
        title: 'Population of Largest U.S. Cities',
        chartArea: {width: '50%'},
        hAxis: {
          title: 'Total Population',
          minValue: 0
        },
        vAxis: {
          title: 'City'
        }
      };

      var chart = new google.visualization.BarChart(document.getElementById('chart_div'));

      chart.draw(data, options);
    }
Previous Topic:Upgrading BIRT runtime from 4.5 to BIRT runtime 4.8
Next Topic:Birt Excel - width error
Goto Forum:
  


Current Time: Fri Mar 21 04:09:44 EDT 2025

Powered by FUDForum. Page generated in 0.06252 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top