EspressReport 6.6

quadbase.reportdesigner.util
Interface IInputData


public interface IInputData

This interface defines methods to modify the report's input data properties, including file or database information, and accessing individual records. A handle to an object that implements this interface can be obtained by calling the gethInputData method defined in QbReport.


Method Summary
 void addRow(IRow r)
          Adds a new row to the report input data.
 void deleteRow(int rowId)
          Delete a record(row) from the report input data.
 java.lang.String getClassFile()
          Gets the name of the input class file used to create the report.
 IResultSet getData()
          Returns the IResultSet object containing the input report data.
 IDatabaseInfo getDatabaseInfo()
          Gets the database info used for plotting the report.
 java.lang.String getDataFile()
          Gets the name of the input data file used to create the report.
 java.lang.String getDTDFile()
          Gets the name of the input dtd file used to create the report.
 quadbase.common.util.internal.ExcelFileInfo getExcelFileInfo()
          Gets the Excel info used for the report.
 ColInfo[] getMapping()
          Returns the data column mapping information.
 java.lang.String getQueryFilename()
          Gets a query file (*.qry) for plotting the report.
 IRow getRow(int rowId)
          Gets the specified row data from the report.
 int getRowCount()
          Returns the total number of rows in the input data.
 quadbase.common.paramquery.SalesForceQueryFileInfo getSalesForceQueryInfo()
          Gets the SalesForce info used for the report.
 ISpreadSheetModel getSpreadSheetModel()
          Returns the spread sheet model for the report, if one is set.
 java.lang.String getXMLFile()
          Gets the name of the input xml file used to create the report.
 XMLFileQueryInfo getXMLFileQueryInfo()
          Gets the xml file query info used to create the report.
 int matchRecord(IRow r)
          Get the row number containing the record that matches the input row.
 IQueryFileInfo readQueryFile(java.lang.String filename)
          Reads a query file (*.qry) and returns a IQueryFileInfo object.
 void replaceAllDatabaseInfo(java.util.Hashtable<java.lang.String,java.util.Properties> databaseMap, java.util.Properties defaultVal, boolean setNewData)
          Replaces all database information associated with this report.
 void replaceAllDatabaseInfo(java.lang.String originalUrl, java.lang.String url, java.lang.String driver, java.lang.String usr, java.lang.String pwd, boolean setNewData)
          Replaces all database information associated with this report.
 void replaceColumns(quadbase.reportdesigner.util.ReplaceColumnInfoList infoList)
           
 void setAllDatabaseInfo(java.sql.Connection conn)
          Sets all database connection(s) associated with this report.
 void setAllDatabaseInfo(java.sql.Connection conn, boolean setNewData)
          Sets all database connection(s) associated with this report.
 void setAllDatabaseInfo(java.sql.Connection conn, boolean setNewData, boolean sorteddata)
           
 void setAllDatabaseInfo(java.lang.String url, java.lang.String driver, java.lang.String usr, java.lang.String pwd)
          Sets all database information associated with this report.
 void setAllDatabaseInfo(java.lang.String url, java.lang.String driver, java.lang.String usr, java.lang.String pwd, boolean setNewData)
          Sets all database information associated with this report.
 void setAllDatabaseInfo(java.lang.String url, java.lang.String driver, java.lang.String usr, java.lang.String pwd, boolean setNewData, boolean sorteddata)
           
 void setAllJNDIDatabaseInfo(java.util.Hashtable<java.lang.String,java.lang.String> env, java.lang.String jndiName)
           
 void setAllSalesForceInfo(java.lang.String serverUrl, java.lang.String sessionId)
          Sets SalesForce Server URL and Session ID associated with this report.
 void setClassFile(java.lang.String className)
          Sets the input class file, which is used to create a report.
 void setClassFile(java.lang.String className, boolean sortedData)
          Sets the input class file, which is used to create a report.
 void setClassFile(java.lang.String className, boolean sortedData, boolean showPromptDialog)
          Sets the input class file, which is used to create a report.
 void setData(IResultSet rs)
          Sets the input data for the report using an IResultSet object.
 void setData(IResultSet rs, boolean sortedData)
          Sets the input data for the report using an IResultSet object.
 void setData(IResultSet rs, boolean sortedData, boolean optimizeMemory)
          Sets the input data for the report using an IResultSet object.
 void setData(IResultSet rs, boolean sortedData, boolean optimizeMemory, java.lang.Object[] distinctValue)
          Sets the input data for the report using an IResultSet object.
 void setDatabaseInfo(quadbase.common.util.IDatabaseInfo db)
          Sets the input database information, which is used to create a report.
 void setDatabaseInfo(quadbase.common.util.IDatabaseInfo db, boolean setNewData)
           
 void setDatabaseInfo(quadbase.common.util.IDatabaseInfo db, boolean setNewData, boolean sorteddata)
           
 void setDataFile(java.lang.String fileName)
          Sets the input data file, which is used to create a report.
 void setDataFile(java.lang.String fileName, boolean sortedData)
          Sets the input data file, which is used to create a report.
 void setDataFile(java.lang.String fileName, boolean sortedData, java.lang.String encoding)
          Sets the input data file, which is used to create a report.
 void setExcelFileInfo(quadbase.common.util.internal.ExcelFileInfo excelInfo)
          Sets the Excel info for the report.
 void setJNDIDatabaseInfo(quadbase.common.util.IDatabaseInfo dbinfo, boolean setNewData, boolean sorteddata)
           
 void setMapping(ColInfo[] info)
          Set the report column mapping.
 void setQueryFilename(java.lang.String filename)
          Sets a query file (*.qry) for plotting the report.
 void setSalesForceQueryInfo(quadbase.common.paramquery.SalesForceQueryFileInfo sfQueryInfo)
          Sets the SalesForce info for the report.
 void setSpreadSheetModel(ISpreadSheetModel sheet)
          Sets the report's spread sheet model to the given object.
 void setXMLFile(java.lang.String xmlName)
          Sets the input xml file, which is used to create a report.
 void setXMLFile(java.lang.String xmlName, boolean sortedData)
          Sets the input xml file, which is used to create a report.
 void setXMLFileQueryInfo(XMLFileQueryInfo xmlInfo)
          Sets the xml file query info, which is used to create a report.
 void setXMLFileQueryInfo(XMLFileQueryInfo xmlInfo, boolean sortedData)
          Sets the xml file query info, which is used to create a report.
 void updateRow(int rowId, IRow r)
          Update the specified row in the report.
 

Method Detail

getMapping

ColInfo[] getMapping()
Returns the data column mapping information.

Returns:
the report column mapping information
See Also:
ColInfo

setMapping

void setMapping(ColInfo[] info)
Set the report column mapping.

Parameters:
info - An instance of ColInfo containing the column mappings.
See Also:
ColInfo

getDatabaseInfo

IDatabaseInfo getDatabaseInfo()
Gets the database info used for plotting the report. Only valid if the report was created by performing a database query.

Returns:
An object containing the database information.
See Also:
IDatabaseInfo, IQueryFileInfo

setDatabaseInfo

void setDatabaseInfo(quadbase.common.util.IDatabaseInfo db)
                     throws java.lang.Exception
Sets the input database information, which is used to create a report.

Parameters:
db - An IDatabaseInfo implementation object containing the database connect info and search query.
Throws:
java.lang.Exception
See Also:
IDatabaseInfo, IQueryFileInfo

setDatabaseInfo

void setDatabaseInfo(quadbase.common.util.IDatabaseInfo db,
                     boolean setNewData)
                     throws java.lang.Exception
Throws:
java.lang.Exception

setDatabaseInfo

void setDatabaseInfo(quadbase.common.util.IDatabaseInfo db,
                     boolean setNewData,
                     boolean sorteddata)
                     throws java.lang.Exception
Throws:
java.lang.Exception

setAllDatabaseInfo

void setAllDatabaseInfo(java.lang.String url,
                        java.lang.String driver,
                        java.lang.String usr,
                        java.lang.String pwd)
                        throws java.lang.Exception
Sets all database information associated with this report. Any sub-report, drill-down report, and chart that uses a database data source will be changed to use the specified database information as well.

Parameters:
url - the url that identifies the database
driver - the name of the jdbc driver class
usr - the user name to login to this database, or null
pwd - the password to login to this database, or null
Throws:
java.lang.Exception

setAllDatabaseInfo

void setAllDatabaseInfo(java.lang.String url,
                        java.lang.String driver,
                        java.lang.String usr,
                        java.lang.String pwd,
                        boolean setNewData)
                        throws java.lang.Exception
Sets all database information associated with this report. Any sub-report, drill-down report, and chart that uses a database data source will be changed to use the specified database information as well.

Parameters:
url - the url that identifies the database
driver - the name of the jdbc driver class
usr - the user name to login to this database, or null
pwd - the password to login to this database, or null
setNewData - whether to hit the database to set new data for the report
Throws:
java.lang.Exception

setAllDatabaseInfo

void setAllDatabaseInfo(java.lang.String url,
                        java.lang.String driver,
                        java.lang.String usr,
                        java.lang.String pwd,
                        boolean setNewData,
                        boolean sorteddata)
                        throws java.lang.Exception
Throws:
java.lang.Exception

setAllJNDIDatabaseInfo

void setAllJNDIDatabaseInfo(java.util.Hashtable<java.lang.String,java.lang.String> env,
                            java.lang.String jndiName)
                            throws java.lang.Exception
Throws:
java.lang.Exception

setJNDIDatabaseInfo

void setJNDIDatabaseInfo(quadbase.common.util.IDatabaseInfo dbinfo,
                         boolean setNewData,
                         boolean sorteddata)
                         throws java.lang.Exception
Throws:
java.lang.Exception

replaceAllDatabaseInfo

void replaceAllDatabaseInfo(java.lang.String originalUrl,
                            java.lang.String url,
                            java.lang.String driver,
                            java.lang.String usr,
                            java.lang.String pwd,
                            boolean setNewData)
                            throws java.lang.Exception
Replaces all database information associated with this report. Any sub-report, drill-down report, and chart that uses the originalUrl database data source will be changed to use the specified database information. The remaining data sources will remain the same

Parameters:
originalUrl - the original database url to replace
url - the url that identifies the database
driver - the name of the jdbc driver class
usr - the user name to login to this database, or null
pwd - the password to login to this database, or null
setNewData - whether to hit the database to set new data for the report
Throws:
java.lang.Exception

replaceAllDatabaseInfo

void replaceAllDatabaseInfo(java.util.Hashtable<java.lang.String,java.util.Properties> databaseMap,
                            java.util.Properties defaultVal,
                            boolean setNewData)
                            throws java.lang.Exception
Replaces all database information associated with this report. The hashtable maps old database url to new database Properties. The Properties must include 4 keys (case sensitive): This method will go through each subreport, drilldown, and chart and check the hashtable for any matches, if a match is made, the database information is replaced. If a match cannot be found and defaultVal is not null, it will replace the database info with the defaultVal Properties. In all other cases the database is unchanged.

Parameters:
databaseMap - the map containing previous database url as keys mapped to new database Properties
defaultVal - if a report/chart is using a database url not found in the databaseMap, it will replace the database information to those contained in defaultVal only if defaultVal is not null.
setNewData - whether to hit the database to set new data for the report
Throws:
java.lang.Exception

setAllDatabaseInfo

void setAllDatabaseInfo(java.sql.Connection conn)
                        throws java.lang.Exception
Sets all database connection(s) associated with this report. Any sub-report, drill-down report, and chart that uses a database data source will be changed to use the specified database connection as well.

Parameters:
conn - the database connection object to use
Throws:
java.lang.Exception

setAllDatabaseInfo

void setAllDatabaseInfo(java.sql.Connection conn,
                        boolean setNewData)
                        throws java.lang.Exception
Sets all database connection(s) associated with this report. Any sub-report, drill-down report, and chart that uses a database data source will be changed to use the specified database connection as well.

Parameters:
conn - the database connection object to use
setNewData - whether to hit the database to set new data for the report
Throws:
java.lang.Exception

setAllDatabaseInfo

void setAllDatabaseInfo(java.sql.Connection conn,
                        boolean setNewData,
                        boolean sorteddata)
                        throws java.lang.Exception
Throws:
java.lang.Exception

replaceColumns

void replaceColumns(quadbase.reportdesigner.util.ReplaceColumnInfoList infoList)
                    throws java.lang.Exception
Throws:
java.lang.Exception

getQueryFilename

java.lang.String getQueryFilename()
Gets a query file (*.qry) for plotting the report. A query file is a hard copy of a IQueryFileInfo object, which contains database driver, url, username, password, input parameters(if applicable) and output parameters(if applicable) IQueryFileInfo is a subclass of IDatabaseInfo

Returns:
A query file name with extension *.qry return null if no query file is used
See Also:
IDatabaseInfo, IQueryFileInfo

setQueryFilename

void setQueryFilename(java.lang.String filename)
                      throws java.lang.Exception
Sets a query file (*.qry) for plotting the report. A query file is a hard copy of a IQueryFileInfo object, which contains database driver, url, username, password, input parameters(if applicable) and output parameters(if applicable) IQueryFileInfo is a subclass of IDatabaseInfo

Parameters:
filename - A query file name with extension *.qry
Throws:
java.lang.Exception
See Also:
IDatabaseInfo, IQueryFileInfo

readQueryFile

IQueryFileInfo readQueryFile(java.lang.String filename)
                             throws java.lang.Exception
Reads a query file (*.qry) and returns a IQueryFileInfo object.

Parameters:
filename - A query file name with extension *.qry
Returns:
A IQueryFileInfo object
Throws:
java.lang.Exception

setDataFile

void setDataFile(java.lang.String fileName)
                 throws java.io.IOException
Sets the input data file, which is used to create a report.

Parameters:
fileName - The name of the input data file.
Throws:
java.io.IOException

setDataFile

void setDataFile(java.lang.String fileName,
                 boolean sortedData)
                 throws java.io.IOException
Sets the input data file, which is used to create a report.

Parameters:
fileName - The name of the input data file.
sortedData - Specify if the result set is sorted.
Throws:
java.io.IOException

setDataFile

void setDataFile(java.lang.String fileName,
                 boolean sortedData,
                 java.lang.String encoding)
                 throws java.io.IOException
Sets the input data file, which is used to create a report.

Parameters:
fileName - The name of the input data file.
sortedData - Specify if the result set is sorted.
encoding - The encoding of the file
Throws:
java.io.IOException

getDataFile

java.lang.String getDataFile()
Gets the name of the input data file used to create the report.

Returns:
The name of the input data file.

setClassFile

void setClassFile(java.lang.String className)
                  throws java.io.IOException
Sets the input class file, which is used to create a report.

Parameters:
className - The name of the input class.
Throws:
java.io.IOException

setClassFile

void setClassFile(java.lang.String className,
                  boolean sortedData)
                  throws java.io.IOException
Sets the input class file, which is used to create a report.

Parameters:
className - The name of the input class.
sortedData - Specify if the result set is sorted.
Throws:
java.io.IOException

setClassFile

void setClassFile(java.lang.String className,
                  boolean sortedData,
                  boolean showPromptDialog)
                  throws java.io.IOException
Sets the input class file, which is used to create a report.

Parameters:
className - The name of the input class.
sortedData - Specify if the result set is sorted.
showPromptDialog - show parameter prompt dialog, false if sub report and the parameter is shared.
Throws:
java.io.IOException

getClassFile

java.lang.String getClassFile()
Gets the name of the input class file used to create the report.

Returns:
The name of the input class file.

setXMLFileQueryInfo

void setXMLFileQueryInfo(XMLFileQueryInfo xmlInfo)
Sets the xml file query info, which is used to create a report.

Parameters:
xmlInfo - The XMLFileQueryInfo.

setXMLFileQueryInfo

void setXMLFileQueryInfo(XMLFileQueryInfo xmlInfo,
                         boolean sortedData)
Sets the xml file query info, which is used to create a report.

Parameters:
xmlInfo - The XMLFileQueryInfo.
sortedData - Specify if the result set is sorted.

getXMLFileQueryInfo

XMLFileQueryInfo getXMLFileQueryInfo()
Gets the xml file query info used to create the report.

Returns:
The XMLFileQueryInfo.

setXMLFile

void setXMLFile(java.lang.String xmlName)
                throws java.io.IOException
Sets the input xml file, which is used to create a report.

Parameters:
xmlName - The name of the input xml file.
Throws:
java.io.IOException

setXMLFile

void setXMLFile(java.lang.String xmlName,
                boolean sortedData)
                throws java.io.IOException
Sets the input xml file, which is used to create a report.

Parameters:
xmlName - The name of the input xml file.
sortedData - Specify if the result set is sorted.
Throws:
java.io.IOException

getXMLFile

java.lang.String getXMLFile()
Gets the name of the input xml file used to create the report.

Returns:
The name of the input xml file.

getDTDFile

java.lang.String getDTDFile()
Gets the name of the input dtd file used to create the report.

Returns:
The name of the input dtd file.

addRow

void addRow(IRow r)
Adds a new row to the report input data.

Parameters:
r - An object of type quadbase.reportdesigner.util.IRow
See Also:
IRow

deleteRow

void deleteRow(int rowId)
Delete a record(row) from the report input data.

Parameters:
rowId - The row number to delete.

updateRow

void updateRow(int rowId,
               IRow r)
Update the specified row in the report.

Parameters:
rowId - The row number to update
r - The new row values.
See Also:
IRow

getRow

IRow getRow(int rowId)
Gets the specified row data from the report.

Parameters:
rowId - The row number.
Returns:
The IRow object containing the row data.
See Also:
IRow

getRowCount

int getRowCount()
Returns the total number of rows in the input data.

Returns:
The total number of rows in the input data set.

matchRecord

int matchRecord(IRow r)
Get the row number containing the record that matches the input row.

Parameters:
r - The IRow object for which the row number is desired.
Returns:
The row number in the data set.
See Also:
IRow

getData

IResultSet getData()
Returns the IResultSet object containing the input report data.

Returns:
The IResultSet object.
See Also:
IResultSet

setData

void setData(IResultSet rs)
             throws java.lang.Exception
Sets the input data for the report using an IResultSet object.

Parameters:
rs - The IResultSet object
Throws:
java.lang.Exception
See Also:
IResultSet

setData

void setData(IResultSet rs,
             boolean sortedData)
             throws java.lang.Exception
Sets the input data for the report using an IResultSet object. If the result set is sorted, the report can be built more efficiently.

Parameters:
rs - The IResultSet object
sortedData - Specify if the result set is sorted.
Throws:
java.lang.Exception
See Also:
IResultSet

setData

void setData(IResultSet rs,
             boolean sortedData,
             boolean optimizeMemory)
             throws java.lang.Exception
Sets the input data for the report using an IResultSet object. If the result set is sorted, the report can be built more efficiently.

Parameters:
rs - The IResultSet object
sortedData - Specify if the result set is sorted.
optimizeMemory - Whether data from database would get obtained in chunks to save
Throws:
java.lang.Exception
See Also:
IResultSet

setData

void setData(IResultSet rs,
             boolean sortedData,
             boolean optimizeMemory,
             java.lang.Object[] distinctValue)
             throws java.lang.Exception
Sets the input data for the report using an IResultSet object. If the result set is sorted, the report can be built more efficiently.

Parameters:
rs - The IResultSet object
sortedData - Specify if the result set is sorted.
optimizeMemory - Whether data from database would get obtained in chunks to save
distinctValue - Distinct value Object array for CrossTab report, used when optimize memory is set to true
Throws:
java.lang.Exception
See Also:
IResultSet

getSpreadSheetModel

ISpreadSheetModel getSpreadSheetModel()
Returns the spread sheet model for the report, if one is set.

See Also:
ISpreadSheetModel

setSpreadSheetModel

void setSpreadSheetModel(ISpreadSheetModel sheet)
Sets the report's spread sheet model to the given object.

Parameters:
sheet - the spreadsheet model object
See Also:
ISpreadSheetModel

getSalesForceQueryInfo

quadbase.common.paramquery.SalesForceQueryFileInfo getSalesForceQueryInfo()
Gets the SalesForce info used for the report. Only valid if the report was created from SalesForce data source.

Returns:
SalesForce data source information
See Also:
SalesForceQueryFileInfo

setSalesForceQueryInfo

void setSalesForceQueryInfo(quadbase.common.paramquery.SalesForceQueryFileInfo sfQueryInfo)
                            throws java.lang.Exception
Sets the SalesForce info for the report.

Parameters:
sfQueryInfo - SalesForce data source information
Throws:
java.lang.Exception - if an error occurred
See Also:
SalesForceQueryFileInfo

setAllSalesForceInfo

void setAllSalesForceInfo(java.lang.String serverUrl,
                          java.lang.String sessionId)
                          throws java.lang.Exception
Sets SalesForce Server URL and Session ID associated with this report. Any sub-report, drill-down report, and chart that uses SalesForce data source will be changed to use the specified Server URL and Session ID as well.

Parameters:
serverUrl - new Server URL
sessionId - new Session ID
Throws:
java.lang.Exception - if error occurs

getExcelFileInfo

quadbase.common.util.internal.ExcelFileInfo getExcelFileInfo()
Gets the Excel info used for the report. Only valid if the report was created from Excel data source.

Returns:
SalesForce data source information
See Also:
ExcelFileInfo

setExcelFileInfo

void setExcelFileInfo(quadbase.common.util.internal.ExcelFileInfo excelInfo)
                      throws java.lang.Exception
Sets the Excel info for the report.

Parameters:
excelInfo - Excel data source information
Throws:
java.lang.Exception - if an error occurred
See Also:
ExcelFileInfo

EspressReport 6.6