Class JDPFormatDoc

java.lang.Object
   |
   +----JDPFormatDoc

public class JDPFormatDoc
extends Object
Class JDPFormatDoc represents a class for formatting reports into html and other formats.


Variable Index

 o CSV
 o EXCEL
 o HTML
 o PLAIN

Constructor Index

 o JDPFormatDoc(JDPUser)
Creates a document formatter.

Method Index

 o addComponent(Component)
Add the component to be drawn.
 o addDetailHeader(String[])
Add a detail header to the output document
 o addDetailLine(String[])
Add a detail line to the output document
 o addGrid(JDPTextGrid)
Add a JDPTextGrid to the document with the grid turned on
 o addGrid(JDPTextGrid, int)
Add a JDPTextGrid to the document with the specified grid width
 o addHeader(String, String)
Set the title of the document
 o addReport(JDPTextGrid)
Add a JDPTextGrid to the document with the grid turned off
 o createDetailHeader(String[], int, int, int)
Add a detail header to the output document
 o createDetailHeader(String[], int, int, int, String)
Add a detail header to the output document
 o createDetailLine(String[])
Add a detail line to the output document
 o createHeader(String, String)
Set the title of the document
 o finishOutput()
Finish off the document
 o finishOutput(int)
Finish off the document
 o getFinishedDocument()
Retrieve the text for the finished document
 o initDocument(int)
Initialise a new document by creating the necessary header
 o loadDocument()
Load the finished document to an external viewer
 o setBody(String)
Set the body of the document
 o setTitle(String)
Set the title of the document

Variables

 o HTML
 public static final int HTML
 o CSV
 public static final int CSV
 o PLAIN
 public static final int PLAIN
 o EXCEL
 public static final int EXCEL

Constructors

 o JDPFormatDoc
 public JDPFormatDoc(JDPUser user)
Creates a document formatter.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.

Methods

 o initDocument
 public void initDocument(int docType)
Initialise a new document by creating the necessary header

Parameters:
docType - the type of document to create and initialise
 o setTitle
 public void setTitle(String docTitle)
Set the title of the document

Parameters:
title - the title of the document
 o setBody
 public void setBody(String bodyParams)
Set the body of the document

Parameters:
bodyParams - the body parameters of the document
 o addHeader
 public void addHeader(String header,
                       String headerTag)
Set the title of the document

Parameters:
title - the title of the document
 o createHeader
 public String createHeader(String header,
                            String headerTag)
Set the title of the document

Parameters:
title - the title of the document
 o addDetailHeader
 public void addDetailHeader(String detailHeaders[])
Add a detail header to the output document

Parameters:
detailHeaders - the headers for a detail line of the output document
 o createDetailHeader
 public String createDetailHeader(String detailHeaders[],
                                  int border,
                                  int cellpadding,
                                  int cellspacing)
Add a detail header to the output document

Parameters:
detailHeaders - the headers for a detail line of the output document
 o createDetailHeader
 public String createDetailHeader(String detailHeaders[],
                                  int border,
                                  int cellpadding,
                                  int cellspacing,
                                  String width)
Add a detail header to the output document

Parameters:
detailHeaders - the headers for a detail line of the output document
 o addDetailLine
 public void addDetailLine(String detailData[])
Add a detail line to the output document

Parameters:
detailData - the data for a detail line of the output document
 o createDetailLine
 public String createDetailLine(String detailData[])
Add a detail line to the output document

Parameters:
detailData - the data for a detail line of the output document
 o finishOutput
 public void finishOutput()
Finish off the document

 o finishOutput
 public void finishOutput(int toStackSize)
Finish off the document

 o getFinishedDocument
 public String getFinishedDocument()
Retrieve the text for the finished document

Returns:
the text for the finished document
 o loadDocument
 public void loadDocument()
Load the finished document to an external viewer

 o addComponent
 public void addComponent(Component comp)
Add the component to be drawn. This routine will add the component and all of it's subcomponents to the document. Some components are not yet supported. This method may be called for each individual component also.

Parameters:
component - the component to be added to the document
 o addReport
 public void addReport(JDPTextGrid grid)
Add a JDPTextGrid to the document with the grid turned off

Parameters:
grid - the text grid to be add to the document
 o addGrid
 public void addGrid(JDPTextGrid grid)
Add a JDPTextGrid to the document with the grid turned on

Parameters:
grid - the text grid to be add to the document
 o addGrid
 public void addGrid(JDPTextGrid grid,
                     int borderWidth)
Add a JDPTextGrid to the document with the specified grid width

Parameters:
grid - the text grid to be add to the document
gridwidth - the width in pixels of the grid