Class jet.bean.JRDirectViewer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----jet.bean.JRDirectViewer

public class JRDirectViewer
extends Panel
implements AdjustmentListener, Externally, JReportPrintListener, ActionListener

Variable Index

 o vDebug
The constant for setShowInfoLevel.
 o vError
The constant for setShowInfoLevel.
 o vOff
The constant for setShowInfoLevel.

Constructor Index

 o JRDirectViewer()
Default constructor.
 o JRDirectViewer(boolean)
Default constructor.

Method Index

 o actionPerformed(ActionEvent)
 
 o adjustmentValueChanged(AdjustmentEvent)
 
 o exit()
Exits the current report engine, the method Calling  will delete the temporary file that is created by the report engine.
 o exportToHtml(String)
Exports the report file(with the .cls extension) to a HTML file.
 o exportToPdf(String)
Exports the report file(with the .cls extension) to a PDF file.
 o exportToRst(String)
Exports the report file( with the .cls extension)to a result report(with the .rst extension).
 o exportToText(String, boolean)
Exports the current report to a TEXT file.
 o firstPage()
Enables the users to go to the first page of the report.
 o getCatName()
Gets the current catalog name.
 o getCurrentPageNumber()
Gets the current page number of the report.
 o getPort()
Gets the current used port address.
 o getPrintStatus()
 
 o getReportName()
Gets the name of the report which is being viewed
 o getServerName()
Gets the server or IP address which is running the report.
 o getStatus()
Gets the current status of the viewer bean"
 o getTotalPageNumber()
Gets the total page numbers of the report.
 o gotoPage(int)
Enables the users to go to the certain page of the report.
 o lastPage()
Goes to the end page of the report.
 o loadReport(String)
Loads the result file from the server directly
 o nextPage()
Goes to the next page of the report.
 o prevPage()
Goes to the previous page of the report.
 o printEnd()
 
 o printReport()
 
 o printReport(Object, Object, boolean)
Prints a result report
 o printStart()
 
 o readExternal(ObjectInput)
 
 o runReport()
the method Calling is to launch the Viewer Bean run
 o setCatName(String)
Specifies the name of the catalog which will be used.
 o setLoadReport(String)
Loads the report, the method calling  will make the report engine run.
 o setLogFile(String)
Sets the name of the log file.
 o setNamedWherePortion(String)
Sets the WHERE portion specified by the where portion name
 o setPort(String)
Sets the port number.
 o setReportName(String)
Sets the name of the report which you choose to view.
 o setServerName(String)
Sets the server or IP address.
 o setShowInfoLevel(int)
Sets show debug information level.
 o setWherePortion(String)
Sets the WHERE portion to the query.
 o writeExternal(ObjectOutput)
 

Variables

 o vOff

 public static final int vOff
The constant for setShowInfoLevel. specifies a turning off debug and an error information.
See Also:
setShowInfoLevel

 o vDebug

 public static final int vDebug
The constant for setShowInfoLevel. specifise a turning on debug information.
See Also:
setShowInfoLevel

 o vError

 public static final int vError
The constant for setShowInfoLevel. specifies a turning on error information.
See Also:
setShowInfoLevel

Constructors

 o JRDirectViewer

 public JRDirectViewer()
Default constructor.

 o JRDirectViewer

 public JRDirectViewer(boolean showButton)
Default constructor.

Methods

 o setServerName

 public void setServerName(String serverName)
Set the server or IP address.
Parameters:
serverName - the name of the server which runs the report.
See Also:
getServerName

 o getServerName

 public String getServerName()
Get the server or IP address which is running the report.
Returns:
serverName the name or address of the current server.
See Also:
setServerName

 o setPort

 public void setPort(String port)
Set the port number.
Parameters:
port - the port number.
See Also:
getPort

 o getPort

 public String getPort()
Get the current used port address.
Returns:
the port address.
See Also:
setPort

 o getReportName

 public String getReportName()
Get the name of the report which is being viewed
Returns:
the name of report
See Also:
setReportName

 o setReportName

 public void setReportName(String reportName)
Set the name of the report which you choose to view.
Parameters:
reportName - the name of report which will be viewed.
See Also:
getReportName

 o setCatName

 public void setCatName(String catName)
Specify the name of  the catalog which will be used.
Parameters:
catName - the name of  the catalog which contains all the required objects used in the report.
See Also:
getCatName

 o getCatName

 public String getCatName()
Get the current catalog name.
Returns:
the name of the catalog which contains all the required objects used in the report.
See Also:
setCatName

 o setLoadReport

 public void setLoadReport(String loadReport)
Load the report, the method calling  will make the report engine run.
Parameters:
loadReport - indicates whether to load the report, if yes, then load.

 o runReport

 public void runReport()
the method Calling is to launch the Viewer Bean  to run

 o printReport

 public void printReport()

 o printReport

 public void printReport(Object printJob, Object pageFormat, boolean bInteractive)
Print a result report
Parameters:
printJob - the java.awt.PrintJob in JDK1.1.x, the java.awt.print.PrinterJob in JDK1.2.x
pageFormat - the java.awt.print.PageFormat in JDK1.2.x.
bInteractive - If displaying print dialog in JDK1.2.x

 o getPrintStatus

 public String getPrintStatus()

 o setNamedWherePortion

 public void setNamedWherePortion(String name)
Set the WHERE portion specified by the where portion name
Parameters:
name - the name of one of the several portions of the WHERE clause saved in the current catalog

The portion of the provided WHERE clause will be appended to the end of the QUERY associated with the definition by either: ADDing the portion of the WHERE clause to any joining statements that are defined in the QUERY or by adding the WHERE clause where the portion of it you have specified becomes the entire WHERE clause.

See Also:
setWherePortion

 o setWherePortion

 public void setWherePortion(String where)
Set the WHERE portion to the query.
Parameters:
where - the portion of the WHERE clause

The portion of the provided  WHERE clause  will be appended to the end of the QUERY associated with the definition by either: ADDing the portion of the WHERE clause to any joining statements that are defined in the QUERY or by adding the WHERE clause where the portion of it you have specified becomes the entire WHERE clause.

See Also:
setNamedWherePortion

 o loadReport

 public boolean loadReport(String urlView) throws IOException
Load the result file from server directly
Parameters:
urlview - the URL of the report file which is to be viewed
Returns:
loading state

 o exportToRst

 public boolean exportToRst(String rstFile)
Export the report file( with the .cls extension)to a result report(with the .rst extension).
Parameters:
rstFile - the name of the result report.
Returns:
true if exportation is successful.
See Also:
exportToHtml, exportToPdf, exportToText

 o exportToHtml

 public boolean exportToHtml(String htmlFile)
Export the report file(with the .cls extension) to a HTML file.
Parameters:
htmlFile - the name of the HTML file report.
Returns:
true if exportation  is successful.
See Also:
exportToRst, exportToPdf, exportToText

 o exportToPdf

 public boolean exportToPdf(String pdfFile)
Export the report file(with the .cls extension) to a PDF file.
Parameters:
pdfFile - the name of the PDF file report.
Returns:
true if exportation is successful.
See Also:
exportToRst, exportToHtml, exportToText

 o exportToText

 public boolean exportToText(String txtFile,
                             boolean isNormalText)
Export  the current report to a TEXT file.
Parameters:
textFileName - the TEXT file name.
isNormalText - is to set whether this text file is a normal text format or a standard data format

the standard data format text file is the text file that each row of it represents each record in the report. It can be used as a text datasource to exchange data with other applications

Returns:
true if exportation  is successful
See Also:
exportToRst, exportToHtml, exportToPdf

 o exit

 public void exit()
Exit the current report engine,the method Calling will delete the temporary file that is created by the report engine.

 o getStatus

 public String getStatus()
Get the current status of the viewer bean"
Returns:
a string, it could be: "Ok","No Report Load",etc.

 o getCurrentPageNumber

 public int getCurrentPageNumber()
Get the current page number of the report.
Returns:
the current page number, if it is null, return -1
See Also:
getTotalPageNumber, gotoPage, firstPage, prevPage, lastPage, nextPage

 o getTotalPageNumber

 public int getTotalPageNumber()
Get the total page numbers of the report.
Returns:
the total page numbers of the report, if it is null, return -1.
See Also:
getCurrentPageNumber, gotoPage, firstPage, prevPage, lastPage, nextPage

 o gotoPage

 public int gotoPage(int pageNumber)
Enable the users to go to the certain pages of the report.
Parameters:
pageNumber - the specified number of the page. Return this page number, if failed, return -1.
See Also:
getTotalPageNumber, getCurrentPageNumber, firstPage, prevPage, lastPage, nextPage

 o firstPage

 public String firstPage()
Enable the users to go to the first page of the report.
Returns:
"Ok" if going to the first page successfully, return "No report load" if no report is loaded in, return "No More page" if current page is already the first page.
See Also:
getTotalPageNumber, getCurrentPageNumber, prevPage, lastPage, nextPage, gotoPage

 o prevPage

 public String prevPage()
Go to the previous page of the report.
Returns:
"Ok" if going to the previous page successfully, return "No report load" if no report is loaded in, return "No more page" if current page is already the first page.
See Also:
getTotalPageNumber, getCurrentPageNumber, firstPage, gotoPage, lastPage, nextPage

 o nextPage

 public String nextPage()
Go to the next page of the report.
Returns:
"Ok" if going to the next page successfully, return "No report load" if no report is loaded in, return "No more page" if current page is already the last page.
See Also:
getTotalPageNumber, getCurrentPageNumber, firstPage, prevPage, lastPage, gotoPage

 o lastPage

 public String lastPage()
Go to the end page of the report.
Returns:
"Ok" if going to the last page successfully, return "No report load" if no report is loaded in, return "No more page" if the current page is already first page.
See Also:
getTotalPageNumber, getCurrentPageNumber, firstPage, prevPage, gotoPage, nextPage

 o setShowInfoLevel

 public void setShowInfoLevel(int level)
Set show debug information level.
Parameters:
level - the debug level

the debug level are vDebug, vError and vOff used for showing debug information, error information and turning off debug and error information.

See Also:
setLogFile

 o setLogFile

 public boolean setLogFile(String fileName)
Set the name of the log file. The debug and error information will be saved to this 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 is used. If no file name is specified, the file jreport.log is used

Returns:
true if successful
See Also:
setShowInfoLevel