jet.bean
Class JRSetResultViewer

java.lang.Object
  extended by jet.bean.JRSetResultViewer

public class JRSetResultViewer
extends java.lang.Object

The JRSetResultViewer class function is used for viewing and exporting the reportset rst file information.

Since:
JReport Version 8.0

Field Summary
static int IE
          Indicates that the html browser is IE.
static int NETSCAPE
          Indicates that the html browser is NETSCAPE.
static int vDebug
          Specifies to open the debug log.
static int vError
          Specifies to open the error log.
static int vOff
          Specifies to close the debug and error logs.
 
Constructor Summary
JRSetResultViewer(Communicator communicator)
          Creates a JRSetResultViewer with the communicator.
JRSetResultViewer(java.io.InputStream ins, boolean zip)
          Creates a JRSetResultViewer with the rstFile's input stream and the flag a flag to show if the stream is compressed.
JRSetResultViewer(java.lang.String rstReportSetName)
          Creates a JRSetResultViewer with the reportSetName.
 
Method Summary
 void closeLog()
          Deprecated. The new setting of JReport log is defined in %install root%\bin\LogConfig.properties.
 void exit()
          If you want to quit from JReport Viewer Bean, you should call this method.
static java.util.Vector getAllPrinters()
          Gets all the printers in system.
 java.util.Map getReportInfo()
          Gets the report set information.
 JRResultViewer getResultViewer(java.lang.String reportName, java.lang.String viewerName)
          Gets the JRResultViewer object according to the reportName and viewerName.
 java.lang.String getTempPath()
          Gets the temporary path.
 java.lang.String saveAs(javax.swing.JFrame parent)
          Saves the report set content as one rst file.
 void setHomePath(java.lang.String homepath)
          Sets home path.
 boolean setLogFile(java.lang.String fileName)
          Sets the log file.
 void setShowButton(boolean showButton)
          Sets the flag that indicates whether to show navigation buttons or not for each JRResultViewer object.
 void setShowInfoLevel(int level)
          Enables/disables output error and debug message.
 void setTempPath(java.lang.String sTempPath)
          Sets the temporary path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IE

public static final int IE
Indicates that the html browser is IE.

See Also:
Constant Field Values

NETSCAPE

public static final int NETSCAPE
Indicates that the html browser is NETSCAPE.

See Also:
Constant Field Values

vOff

public static final int vOff
Specifies to close the debug and error logs.

See Also:
Constant Field Values

vDebug

public static final int vDebug
Specifies to open the debug log.

See Also:
Constant Field Values

vError

public static final int vError
Specifies to open the error log.

See Also:
Constant Field Values
Constructor Detail

JRSetResultViewer

public JRSetResultViewer(java.lang.String rstReportSetName)
                  throws java.io.IOException,
                         jet.ie.VersionException
Creates a JRSetResultViewer with the reportSetName.

Parameters:
rstReportSetName - It is a rst file.
Throws:
java.io.IOException - Produces IO error when loading the report set from the rst file.
jet.ie.VersionException - Produces version error when opening the rst file.

JRSetResultViewer

public JRSetResultViewer(Communicator communicator)
Creates a JRSetResultViewer with the communicator.

Parameters:
communicator - The Communicator object.
See Also:
JREngine.getReportCommunicator()

JRSetResultViewer

public JRSetResultViewer(java.io.InputStream ins,
                         boolean zip)
                  throws jet.ie.VersionException,
                         java.io.IOException
Creates a JRSetResultViewer with the rstFile's input stream and the flag a flag to show if the stream is compressed.

Parameters:
ins - The InputStream object from which to read the report information.
zip - The flag that specifies whether the input stream is compressed or not.
Throws:
java.io.IOException - Produces IO error when loading the report set from the rst file.
jet.ie.VersionException - Produces version error when opening the rst file.
Method Detail

setShowButton

public void setShowButton(boolean showButton)
Sets the flag that indicates whether to show navigation buttons or not for each JRResultViewer object.

Parameters:
showButton - If true, the turning page buttons will be shown for each JRResultViewer.

getReportInfo

public java.util.Map getReportInfo()
                            throws jet.ie.VersionException
Gets the report set information.

Returns:
Map Its key is reportName and value is one Vector whose elements are a string array in which the first element is viewerName, the second is description name and the third is display name.

Throws:
jet.ie.VersionException - Produces version error when loading report from the rst file.

getResultViewer

public JRResultViewer getResultViewer(java.lang.String reportName,
                                      java.lang.String viewerName)
                               throws jet.ie.VersionException
Gets the JRResultViewer object according to the reportName and viewerName.

Parameters:
reportName - It is the key of the reportInfo(Map).
viewerName - The reportInfo that holds the viewer name.
Returns:
null if these keys do not correlate with a report in the rst file, otherwise returns the found JRResultViewer object.
Throws:
jet.ie.VersionException
See Also:
getReportInfo()

saveAs

public java.lang.String saveAs(javax.swing.JFrame parent)
Saves the report set content as one rst file.

Parameters:
parent - The file select dialog that shows parent.
Returns:
a String, "Ok" means you have successfully saveas the rst file. "No report load" means no report is loaded in, which also means saveas failed.

exit

public void exit()
If you want to quit from JReport Viewer Bean, you should call this method. This method will do some clean up work such as deleting the temporary files. It is important, so please do not forget to call this method!


closeLog

public void closeLog()
Deprecated. The new setting of JReport log is defined in %install root%\bin\LogConfig.properties.

Closes the log stream.


getAllPrinters

public static java.util.Vector getAllPrinters()
Gets all the printers in system. You can only do this in JDK14 or later JDK version.

Returns:
Vector that holds all available printers in this system.

getTempPath

public java.lang.String getTempPath()
Gets the temporary path.

Returns:
the temppath

setHomePath

public void setHomePath(java.lang.String homepath)
Sets home path.

Parameters:
homepath - The string of home path.

setLogFile

public boolean setLogFile(java.lang.String fileName)
Sets the log file.

Parameters:
fileName - The log file name.

LogFileName Specifies where the debug, error and other information will go. LogFileName contains both the path and the file name. If no path is specified, the current path will be used. If no file name is specified, the file jreport.log will be used.

Returns:
true if successful

setTempPath

public void setTempPath(java.lang.String sTempPath)
Sets the temporary path.

Parameters:
sTempPath - The temporary path(absolute path).

setShowInfoLevel

public void setShowInfoLevel(int level)
Enables/disables output error and debug message.

Parameters:
level - The debug level, for example: vDebug | vError.
See Also:
vDebug, vError, vOff