info.joseluismartin.gui.report
Class ReportManager

java.lang.Object
  extended by info.joseluismartin.gui.report.ReportManager

public abstract class ReportManager
extends Object

This class is used to generate and display reports. Combine it with info.joseluismartin.util.processor.FileProcessor

Author:
Jose A. Corbacho

Nested Class Summary
 class ReportManager.ConnectionFileStrategy
          Implementation of FileStrategy using a Connection as report data source
 class ReportManager.JRDataSourceFileStrategy
          Implementation of FileStrategy using a JRDataSource as report data source
 class ReportManager.ProcessFileStrategy
          Strategy to process the jasper file.
 
Constructor Summary
ReportManager()
          Default ctor.
 
Method Summary
protected abstract  JRParameterEditorDialog createEditorDialog()
           
 DataSource getDataSource()
           
static String getPrefix(String fileName)
           
static String getSuffix(String fileName)
           
 void setDataSource(DataSource dataSource)
           
 void showReport(Report report, DataSource dataSource, String outputType)
          Displays the report in a new window as a file
 void showReport(Report report, PersistentService<Object,Serializable> service, Object filter, String sortPropertyName, Page.Order sortOrder, String outputType)
          Display a report in outputType using the service and available ids to create the data source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportManager

public ReportManager()
Default ctor.

Method Detail

showReport

public void showReport(Report report,
                       PersistentService<Object,Serializable> service,
                       Object filter,
                       String sortPropertyName,
                       Page.Order sortOrder,
                       String outputType)
                throws Exception
Display a report in outputType using the service and available ids to create the data source

Parameters:
report - report to display
filter - filter to use when query data to persistent service
sortPropertyName - sort property name
sortOrder - sort order (ASC, DESC)
service - persistent service to use
outputType - report output type (pdf, xml)
Throws:
Exception

showReport

public void showReport(Report report,
                       DataSource dataSource,
                       String outputType)
                throws ReportingException
Displays the report in a new window as a file

Parameters:
report - the report to be displayed
Throws:
ReportingException

getPrefix

public static String getPrefix(String fileName)

getSuffix

public static String getSuffix(String fileName)

createEditorDialog

protected abstract JRParameterEditorDialog createEditorDialog()

getDataSource

public DataSource getDataSource()
Returns:
the dataSource

setDataSource

public void setDataSource(DataSource dataSource)
Parameters:
dataSource - the dataSource to set


Copyright © 2013 JDAL. All Rights Reserved.