Class jet.bean.JRRunViewer
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----jet.bean.JRRunViewer
- public class JRRunViewer
- extends Panel
- implements AdjustmentListener, Externalizable, JReportPrintListener, ActionListener
vDebug
- The constant for
setShowInfoLevel.
vError
- The constant for
setShowInfoLevel.
vOff
- The constant for
setShowInfoLevel.
JRRunViewer()
- Default constructor.
JRRunViewer(boolean)
- Default constructor.
actionPerformed(ActionEvent)
-
adjustmentValueChanged(AdjustmentEvent)
-
exit()
- Exit the current report engine, cDlling this method will delete the temporary file that
is created by report engine.
exportToHtml(String)
- Export the report file(with the .cls extension) to a HTML file.
exportToPdf(String)
- Export the report file(with the .cls extension) to a PDF file.
exportToRst(String)
- Export the report file( with the .cls extension)to a result report(with the .rst
extension).
exportToText(String, boolean)
- Export current report(with the .rst extension)to a TEXT file.
firstPage()
- Enable the users to go to the first page of the report.
getCatName()
- Get the name of the catalog which is currently being used.
getCurrentPageNumber()
- Get the current page number of the report.
getParameters()
- Get the parameter values of the report.
getPort()
- Get the port number.
getPrintStatus()
- Get the current print status
getReportName()
- Get the name of the report which is being viewed
getServerName()
- Get the name of the server or IP address.
getStatus()
- Get the Current status of JReport Viewer
getTotalPageNumber()
- Get the Total page numbers of the report.
gotoPage(int)
- Enable the users to go to the certain page of the report.
lastPage()
- Go to the end page of the report.
nextPage()
- Go to the next page of the report.
prevPage()
- Go to the previous page of the report.
printEnd()
- End the current print task and enable other print tasks
printReport()
- Print the current report
printReport(Object,
Object, boolean)
- Print a result report
printStart()
- Be ready to print the report and disable other print tasks
readExternal(ObjectInput)
-
runReport()
- Run to view the current report
setCatName(String)
- Specify the catalog name which will be used.
setLoadReport(String)
- Load the report, calling this method will make the report engine run.
setLogFile(String)
- Set the name of the log file.
setNamedWherePortion(String)
- Set the WHERE portion specified by the where portion name
setParameters(String)
- Set the values of parameters needed by the current report.
setPort(String)
- Specify the port address.
setReportName(String)
- Specify the name of report which will be viewed.
setServerName(String)
- Specify the name of the server or IP address
setShowInfoLevel(int)
- Set show debug information level.
setWherePortion(String)
- Set the WHERE portion to the query.
writeExternal(ObjectOutput)
-

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

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

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

JRRunViewer
public JRRunViewer()
- Default constructor.

JRRunViewer
public JRRunViewer(boolean showButton)
- Default constructor.

setServerName
public void setServerName(String serverName)
- Specify the name of the server or IP address
- Parameters:
- serverName - the name of the server or IP address
- See Also:
- getServerName

getServerName
public String getServerName()
- Get the name of the server or IP address.
- Returns:
- the server name or IP address.
- See Also:
- setServerName

setPort
public void setPort(String port)
- Specify the port address.
- Parameters:
- port - the port address
- See Also:
- getPort

getPort
public String getPort()
- Get the port number.
- Returns:
- the port number
- See Also:
- setPort

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

setReportName
public void setReportName(String reportName)
- Specify the name of the report which will be viewed.
- Parameters:
- reportName - the name of the report which will be viewed
- See Also:
- getPort

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

getCatName
public String getCatName()
- Get the name of the catalog which is currently being used.
- Returns:
- the currently used catalog name.
- See Also:
- setCatName

getParameters
public String getParameters()
- Get the parameter values of the report.
- Returns:
- the string containing parameter values of the report.
- See Also:
- setParameters

setParameters
public void setParameters(String parameters)
- Set the value of parameters needed by the current report.
- Parameters:
- parameters - the parameter values needed by report.
- See Also:
- getParameters

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

runReport
public void runReport()
- Run to view the current report

printStart
public void printStart()
- Be ready to print the report and disable other print tasks

printEnd
public void printEnd()
- End the current print task and enable other print tasks

printReport
public void printReport()
- Print the current report
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 display print dialog in JDK1.2.x

getPrintStatus
public String getPrintStatus()
- Get the current print status
- Returns:
- a string containing the current print status could be:"No print
Job","Ok","Busy" etc..

setNamedWherePortion
public void setNamedWherePortion(String name)
- Set the WHERE portion specified by the where portion name
- Parameters:
- name - the name of one of 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

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

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

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

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

exportToText
public boolean exportToText(String txtFile,
boolean isNormalText)
- Export current report(with the .rst extension)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 successful
- See Also:
- exportToRst, exportToHtml, exportToPdf

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

getStatus
public String getStatus()
- Get the Current status of JReport Viewer
- Returns:
- a string, it could be:"Ok","No Report Load",etc..

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

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

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

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, gotoPage, getCurrentPageNumber, prevPage, lastPage, nextPage

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, gotoPage, firstPage, getCurrentPageNumber,
lastPage, nextPage

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, gotoPage, firstPage, prevPage, lastPage,
GetCurrentPageNumber

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 current page is already
first page.
- See Also:
- getTotalPageNumber, gotoPage, firstPage, prevPage, getCurrentPageNumber, nextPage

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

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