fllogosm
 Main
 User's Guide
 Developer's Guide
 Admin's Guide
 FAQ
 License Info
 Feedback
 Form View

Class nrio.reports.FormViewPagePrinter


java.lang.Object
   |
   +----nrio.reports.FormViewPagePrinter


 

public class FormViewPagePrinter extends Object

FormViewPagePrinter is an object that serves one sole purpose: to draw a page of a form view report; it doesn´t set margins, page layout or anything else for what matters. If you are looking for an object that can do everything (that regards form view reports) in a single place, go to the "Page Preview" section of this document.

You may already know that forms can have several tabs (pages), and therefore you may be wondering how this object composes a (screen/paper) page. The answer is quite simple: FormViewPagePrinter decides how many form pages can fit into a screen or paper page (or just uses the numbers you give it), and then starts drawing the form pages one after the other.

Example: let's say that we have a (screen/paper) page that can contain 6 forms (eg, 2 hor. by 3 ver.), and we decide to use a form which has 5 pages. We want to print screen/paper page 2, therefore we get a (screen/paper) page which contains form page 2 of the second record, plus all of the five form pages of the third record.

In order to print a page, you should set all of this object properties (calling all the 'setXXXX' methods), then call drawPage(int, Graphics) passing as parameters the page to be printed and the Graphics object (that has to be already initialized) on which to print.


 

FormViewPagePrinter()
        FormViewPagePrinter constructor.

drawPage(int, Graphics)
        Draws one page of the report into a Graphics object.
getBackground()
        Gets the form background color.
getBottomRightMargin()
        Gets the bottom right margin for the printable area of the page, in pixels.
getForeground()
        Gets the form foreground color.
getFormInit()
        Gets the form init string.
getFormSize()
        Gets the form size.
getHorCopies()
        Gets the number of forms to be printed in a page (in the horizontal direction).
getNumberOfPages()
        Gets the total number of pages of which this report is composed.
getPageSize()
        Gets the page size.
getTopLeftMargin()
        Gets the top left margin for the printable area of the page, in pixels.
getVerCopies()
        Gets the number of forms to be printed in a page (in the vertical direction).
setBackground(Color)
        Sets the form background color.
setBottomRightMargin(Point)
        Sets the bottom right margin for the printable area of the page, in pixels.
setDbStruct(String[][])
        Sets the database fields structure.
setForeground(Color)
        Sets the form foreground color.
setFormInit(String)
        Sets the form init string.
setFormSize(Dimension)
        Sets the form size.
setHorCopies(int)
        Sets the number of forms to be printed in a page (in the horizontal direction).
setPageSize(Dimension)
        Sets the page size.
setRecords(String[][])
        Sets the currently set records.
setTopLeftMargin(Point)
        Sets the top left margin for the printable area of the page, in pixels.
setVerCopies(int)
        Sets the number of forms to be printed in a page (in the vertical direction).

 

FormViewPagePrinter


 public FormViewPagePrinter()
 


        FormViewPagePrinter constructor.

 

drawPage


 public int drawPage(int page,
                     Graphics g)
 


        Draws one page of the report into a Graphics object.
       

    Parameters:
                    page - int
                    g - java.awt.Graphics

     

getBackground


 public Color getBackground()
 


        Gets the form background color.
       

    Returns:
                    The background property value. See Also:
                    setBackground

getBottomRightMargin


 public Point getBottomRightMargin()
 


        Gets the bottom right margin for the printable area of the page, in pixels. This measure is considered to be relative to the bottom right margin of the document (eg. [10, 15] means 10 pixels from the right of the document and 15 from the bottom).
       

    Returns:
                    The bottomRightMargin property value. See Also:
                    setBottomRightMargin

getForeground


 public Color getForeground()
 


        Gets the form foreground color.
       

    Returns:
                    The foreground property value. See Also:
                    setForeground

getFormInit


 public String getFormInit()
 


        Gets the form init string. The form init string is not human readable, it's just what the VFD produces and saves into .mfr files.
       

    Returns:
                    The formInit property value. See Also:
                    setFormInit

getFormSize


 public Dimension getFormSize()
 


        Gets the form size (in pixels).
       

    Returns:
                    The formSize property value. See Also:
                    setFormSize

getHorCopies


 public int getHorCopies()
 


        Gets the number of forms to be printed in a page (in the horizontal direction). If you get 0 (zero) as the return value for this method, it means that an optimal number of forms (as many as they will fit into a page) will be drawn.
       

    Returns:
                    The horCopies property value. See Also:
                    setHorCopies

getNumberOfPages


 public int getNumberOfPages()
 


        Gets the total number of pages of which this report is composed.
       

    Returns:
                    int

getPageSize


 public Dimension getPageSize()
 


        Gets the page size (in pixels). This includes header and footer (basically the whole page size is returned).
       

    Returns:
                    The pageSize property value. See Also:
                    setPageSize

getTopLeftMargin


 public Point getTopLeftMargin()
 


        Gets the top left margin for the printable area of the page, in pixels. This measure is considered to be relative to the bottom right margin of the document (eg. [10, 15] means 10 pixels from the left of the document and 15 from the top).
       

    Returns:
                    The topLeftMargin property value. See Also:
                    setTopLeftMargin

getVerCopies


 public int getVerCopies()
 


        Gets the number of forms to be printed in a page (in the vertical direction). If you get 0 (zero) as the return value for this method, it means that an optimal number of forms (as many as they will fit into a page) will be drawn.
       

    Returns:
                    The verCopies property value. See Also:
                    setVerCopies

setBackground


 public void setBackground(Color background)
 


        Sets the form background color.
       

    Parameters:
                    background - The new value for the property. See Also:
                    getBackground

setBottomRightMargin


 public void setBottomRightMargin(Point bottomRightMargin)
 


        Sets the bottom right margin for the printable area of the page, in pixels. This measure is considered to be relative to the bottom right margin of the document (eg. [10, 15] means 10 pixels from the right of the document and 15 from the bottom).
       

    Parameters:
                    bottomRightMargin - The new value for the property. See Also:
                    getBottomRightMargin

setDbStruct


 public void setDbStruct(String dbs[][])
 


        Sets the database fields structure, exactly as it would be returned by RXDbase or MaxBase dbinfo method (hint hint).
       

    Parameters:
                    dbs - java.lang.String[][]

setForeground


 public void setForeground(Color foreground)
 


        Sets the form foreground color.
       

    Parameters:
                    foreground - The new value for the property. See Also:
                    getForeground

setFormInit


 public void setFormInit(String formInit)
 


        Sets the form init string. The form init string is not human readable, it's just what the VFD produces and saves into .mfr files.
       

    Parameters:
                    formInit - The new value for the property. See Also:
                    getFormInit

setFormSize


 public void setFormSize(Dimension formSize)
 


        Sets the form size (in pixels). Warning: this is not the page size.
       

    Parameters:
                    formSize - The new value for the property. See Also:
                    getFormSize

setHorCopies


 public void setHorCopies(int horCopies)
 


        Sets the number of forms to be printed in a page (in the horizontal direction). If you set 0 (zero) as the parameter for this method, it means that an optimal number of forms (as many as they will fit into a page) will be drawn.
       

    Parameters:
                    horCopies - The new value for the property. See Also:
                    getHorCopies

setPageSize

 


 public void setPageSize(Dimension pageSize)
 


        Sets the page size (in pixels). This includes header and footer (basically the whole page size).
       

    Parameters:
                    pageSize - The new value for the property. See Also:
                    getPageSize

setRecords


 public void setRecords(String rcs[][])
 


        Sets the currently set records, exactly as they were returned by RXDbase or MaxBase loadrecwithfilter method (it's always a wise thing to do to pass the array loadrecwithfilter returns, to this method).
       

    Parameters:
                    rcs - java.lang.String[][]

setTopLeftMargin


 public void setTopLeftMargin(Point topLeftMargin)
 


        Sets the top left margin for the printable area of the page, in pixels. This measure is considered to be relative to the bottom right margin of the document (eg. [10, 15] means 10 pixels from the left of the document and 15 from the top).
       

    Parameters:
                    topLeftMargin - The new value for the property. See Also:
                    getTopLeftMargin

setVerCopies


 public void setVerCopies(int verCopies)
 


        Sets the number of forms to be printed in a page (in the vertical direction). If you set 0 (zero) as the parameter for this method, it means that an optimal number of forms (as many as they will fit into a page) will be drawn.
       

    Parameters:
                    verCopies - The new value for the property. See Also:
                    getVerCopies