generator.setObject("outer-header-color", "red");
final URL in = getReportDefinitionSource();
if (in == null)
{
throw new ReportDefinitionException("URL is invalid");
}
try
{
MasterReport report = generator.parseReport(in);
final StyleSheetCollection styleCollection =
report.getStyleSheetCollection();
final ElementStyleSheet styleSheet =
styleCollection.createStyleSheet("my-style");
styleSheet.setStyleProperty(TextStyleKeys.FONT, "SansSerif");
styleSheet.setStyleProperty(ElementStyleKeys.PAINT, Color.blue);
report.setDataFactory(new TableDataFactory("default", data));
return report;
}
catch (IOException e)
{
throw new ReportDefinitionException("IOError", e);
}
catch (ResourceException e)
{
throw new ReportDefinitionException("ResourceError", e);
}
}