Hi Pete,
sorry for the late reply. Now, there are many ways you can implement your use case and I hope that my answer also along the way answers the question whether ReportServer replaces BIRT or complements it (in short, it does both). So,
the task is to implement the following steps
- read a csv file
- create a bar chart
- send it via email
As I said, there are multiple ways of going about this. For example, you could create a BIRT report with a CSV datasource and render the bar chart in the BIRT report. In ReportServer you could then upload the BIRT report and schedule it such
that you get the result via email. Instead of using the BIRT engine, you could implement the same strategy with the JasperReports engine.
A third option is to use a CSV datasource. If your file is stored on location /tmp/test/somefile.csv you could use the URL connector with the datasource and use the url
file:///tmp/test/somefile.csv
You could then use the datasource to power a Dynamic List. To get to a bar chart from the Dynamic List, you could, for example, have a look into the Excel Templating (https://reportserver.net/en/guides/user/chapters/Dynamic-Lists/#Templates).
Yet another option is to use a script report. Following is an example script that reads the following CSV File
"City", "Population"
"New York City, NY", 8175000
"Los Angeles, CA", 3792000
"Chicago, IL", 2695000
"Houston, TX", 2099000
"Philadelphia, PA", 1526000
The script then renders an HTML document that uses Google’s Chart API to render a bar chart.
import net.datenwerke.rs.base.service.datasources.helpers.*;
/* config */
def filename = "/Path/to/csv/file.csv";
def separator = ',' as char;
def quote = '"' as char;
/* read file */
def data = new File(filename).text;
/* prepare csv helper */
def csvHelper = new CsvToTableModelHelper();
csvHelper.setPreferences(quote, separator, "\n");
/* parse csv */
def model = csvHelper.processCSV(data.getBytes());
/* create html for chart */
def report = """<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'City');
data.addColumn('number', 'Population');
""";
/* add data */
report += "data.addRows(["
report += model.getData().collect{"['${it.getAt(0)}', ${it.getAt(1)}]"}.join(',');
report += "]);";
report += """
// Set chart options
var options = {'title':'City / Poulation',
'width':400,
'height':300};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</body>
</html>"""
return report;
The result (rendered in ReportServer) would look as follows:

Besides using Google’s Chart APIs, you could of course use any other library that allows to render charts.
I hope that this gives you a place to start exploring the possibilities offered ReportServer.
Cheers,
Arno