Class jet.bean.JRResultViewer
jet.bean.JRResultViewer
- public class JRResultViewer extends JPanel
- implements AdjustmentListener, JReportPrintListener, Externalizable, ActionListener
vDebug
- The constant for
setShowInfoLevel.
vError
- The constant for
setShowInfoLevel.
vOff
- The constant for
setShowInfoLevel.
JRResultViewer()
- Default constructor.
JRResultViewer(boolean)
- Default constructor.
exit()
- Exit the current report result viewer, Calling this method will delete the temporary
file that is created by the report result viewer
exportToHtml(String)
- Export the current report(with the .rst extension)to a HTML file.
- This method is not available in JReport
Express Result Viewer.
exportToPdf(String)
- Export current report(with the .rst extension)to a PDF file.
- This method is not available in JReport
Express Result Viewer.
exportToText(String, boolean)
- Export current report(with the .rst extension)to a TEXT file.
- This method is not available in JReport
Express Result Viewer.
firstPage()
- Enable the users to go to the first page of the report.
getCurrentPageNumber()
- Get the current page numbers of the report.
getPrintStatus()
- Get current print status
getReportName()
- Get the name of the report currently being viewed.
getStatus()
- Get the current status of the viewer bean"
getTotalPageNumber()
- Get the total page numbers of the report.
gotoPage(int)
- Enable the users to go to the certain pages 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 printing a report
printReport()
- Print a result report
printReport(Object, Object, boolean)
- Print a result report
printStart()
- Start to print a report
runReport()
- launch the JReport Result Viewer, let it run
setLoadReport(String)
- Load the report, calling this method will make the report engine run.
setLogFile(String)
- Set the name of the log file.
setReportName(String)
- Specify the report name as a UNC path.
setShowInfoLevel(int)
- Set show debug information level.
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
JRResultViewer
public JRResultViewer()
- Default constructor.
JRResultViewer
public JRResultViewer(boolean showButton)
- Default constructor.
getReportName
public String getReportName()
- Get the name of the report currently being viewed.
- Returns:
- the name of the report which is being viewed.
- See Also:
- setReportName
setReportName
public void setReportName(String reportName)
- Specify the report name as a UNC path.
- Parameters:
- reportName - the UNC path definition of the report.
- See Also:
- getReportName
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.
printStart
public void printStart()
- Start to print a report
printEnd
public void printEnd()
- End printing a report
printReport
public void printReport()
- Print a result 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 current print status
runReport
public void runReport()
- launch the JReport Result Viewer, let it run
exportToHtml
public boolean exportToHtml(String htmlFileName)
- Export the current report(with the .rst extension)to a HTML file.
- Parameters:
- htmlFileName - the HTML file name.
- Returns:
- true if exportation successful
- See Also:
- exportToPdf, exportToText
exportToPdf
public boolean exportToPdf(String pdfFileName)
- Export current report(with the .rst extension)to a PDF file.
- Parameters:
- pdfFileName - the PDF file name.
- guipeer - the GUI container being shown.
- Returns:
- true if exportation successful
- See Also:
- exportToHtml, exportToText
exportToText
public boolean exportToText(String textFileName,
boolean isNormalText)
- Export the 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:
- exportToHtml, exportToPdf
exit
public void exit()
- Exit the current report result viewer, Calling this method will delete the temporary
file that is created by report result viewer
getStatus
public String getStatus()
- Get the current status of the viewer bean"
- 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 numbers of the report.
- Returns:
- the total page numbers of the report, if failed, 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 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 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 the 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 the 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 the 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 the current page is already
the 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