ro.nextreports.engine.chart
Class FluentChartRunner

Package class diagram package FluentChartRunner
java.lang.Object
  extended by ro.nextreports.engine.chart.FluentChartRunner

public class FluentChartRunner
extends java.lang.Object


Method Summary
static FluentChartRunner chart(Chart chart)
          Create a FluentChartRunner object
 FluentChartRunner connectTo(java.sql.Connection connection)
          Set the connection to database
 FluentChartRunner formatAs(java.lang.String format)
          Set the output format
 java.lang.String getChartImageAbsolutePath()
          Get chart image asbolute path after export with IMAGE_FORMAT
 java.lang.String getChartImageName()
          Get chart image name after export with IMAGE_FORMAT
 ro.nextreports.engine.exporter.util.TableData getTableData()
          Get table data after export with TABLE_FORMAT
 void run()
          Export the current chart to the specified output format : this method can be used by IMAGE_FORMAT and TABLE_FORMAT
 void run(java.io.OutputStream stream)
          Export the current chart to the specified output format : this method can be used by GRAPHIC_FORMAT For IMAGE_FORMAT use withImagePath method.
 FluentChartRunner withImageHeight(int imageHeight)
          Set image height : has meaning just for IMAGE_FORMAT type if not set, default value is 300
 FluentChartRunner withImageName(java.lang.String imageName)
          Set image name : has meaning just for IMAGE_FORMAT type
 FluentChartRunner withImagePath(java.lang.String imagePath)
          Set image path : has meaning just for IMAGE_FORMAT type
 FluentChartRunner withImageWidth(int imageWidth)
          Set image width : has meaning just for IMAGE_FORMAT type if not set, default value is 500
 FluentChartRunner withParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
          Set the parameters values
 FluentChartRunner withQueryTimeout(int queryTimeout)
          Set the query timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

chart

public static FluentChartRunner chart(Chart chart)
Create a FluentChartRunner object

Parameters:
chart - next chart object
Returns:
the newly created FluentChartRunner object

connectTo

public FluentChartRunner connectTo(java.sql.Connection connection)
Set the connection to database

Parameters:
connection - database connection
Returns:
FluentChartRunner object with database connection set

withQueryTimeout

public FluentChartRunner withQueryTimeout(int queryTimeout)
Set the query timeout

Parameters:
queryTimeout - database execution query timeout in seconds
Returns:
FluentChartRunner object with query timeout set

withParameterValues

public FluentChartRunner withParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
Set the parameters values

Parameters:
parameterValues - map of parameters values where the key is the parameter name and the value is the parameter value(s) Such parameter value can be a simple java object if the parameter has SINGLE SELECTION, or in case of MULTIPLE SELECTION value is an array Object[] of java objects. For an empty list of values , the value must be : new Object[]{ParameterUtil.NULL} If we programatically add value(s) in parameterValues for a hidden parameter, the default values for that hidden parameter will be ignored and the engine will use those from the map.
Returns:
FluentChartRunner object with parameters values set

formatAs

public FluentChartRunner formatAs(java.lang.String format)
Set the output format

Parameters:
format - output format : ChartRunner.GRAPHIC_FORMAT (flash), ChartRunner.TABLE_FORMAT, ChartRunner.IMAGE_FORMAT
Returns:
FluentChartRunner object with output format set

withImagePath

public FluentChartRunner withImagePath(java.lang.String imagePath)
Set image path : has meaning just for IMAGE_FORMAT type

Parameters:
imagePath - image path
Returns:
FluentChartRunner object with image path set

withImageName

public FluentChartRunner withImageName(java.lang.String imageName)
Set image name : has meaning just for IMAGE_FORMAT type

Parameters:
imageName - image name
Returns:
FluentChartRunner object with image name set

withImageWidth

public FluentChartRunner withImageWidth(int imageWidth)
Set image width : has meaning just for IMAGE_FORMAT type if not set, default value is 500

Parameters:
imageWidth - image width
Returns:
FluentChartRunner object with image width set

withImageHeight

public FluentChartRunner withImageHeight(int imageHeight)
Set image height : has meaning just for IMAGE_FORMAT type if not set, default value is 300

Parameters:
imageHeight - image height
Returns:
FluentChartRunner object with image height set

run

public void run(java.io.OutputStream stream)
         throws ReportRunnerException,
                ro.nextreports.engine.exporter.exception.NoDataFoundException,
                java.lang.InterruptedException
Export the current chart to the specified output format : this method can be used by GRAPHIC_FORMAT For IMAGE_FORMAT use withImagePath method.

Parameters:
stream - output stream to write the exported chart
Throws:
ReportRunnerException - if ChartRunner object is not correctly configured
ro.nextreports.engine.exporter.exception.NoDataFoundException - if no data is found
java.lang.InterruptedException - if process was interrupted

run

public void run()
         throws ReportRunnerException,
                ro.nextreports.engine.exporter.exception.NoDataFoundException,
                java.lang.InterruptedException
Export the current chart to the specified output format : this method can be used by IMAGE_FORMAT and TABLE_FORMAT

Throws:
ReportRunnerException - if ChartRunner object is not correctly configured
ro.nextreports.engine.exporter.exception.NoDataFoundException - if no data is found
java.lang.InterruptedException - if process was interrupted

getChartImageName

public java.lang.String getChartImageName()
Get chart image name after export with IMAGE_FORMAT

Returns:
chart image name after export

getChartImageAbsolutePath

public java.lang.String getChartImageAbsolutePath()
Get chart image asbolute path after export with IMAGE_FORMAT

Returns:
chart image absolute path after export

getTableData

public ro.nextreports.engine.exporter.util.TableData getTableData()
Get table data after export with TABLE_FORMAT

Returns:
table data after export with TABLE_FORMAT