|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Data source for an area.
Areas are programatically printed by:
1. Assigning a value to the elements in the area. The following command assigns the value "Article1" to the element "TextDescription".
DETAIL_PurchaseOrder.getItemByName("TextDescription").setruntimeValue("Article1");
and Calling the report's printArea() method:
rep.printArea(DETAIL_PurchaseOrder);
2. or if they are linked to a superarea, after the superarea is printed.
However you can also use a Rsource object. In this case the report will automatically assing the values to the fields and print the area as many times as need. There are 3 implemented Rsource classes, but you can implement your own class.
The following example uses the class RArraySource to print the lines of a Purchase Order:
private static void Example2() {
// example: array as data source
Win= new RReportWindow(rep,MainWindow);
DETAIL_PurchaseOrder.setDataSource(new RArraySource(columnsNames,columnsData));
rep.prepare();
//print here
rep.printArea(DETAIL_PurchaseOrder);
rep.endReport();
Win.show();
}
The array columnsNames contains the names of the fields and the array columnsData contanins the values. See Examples or exampleOrder.java.
Note: you can use a RAreaListener in order to execute your own java code before each repetition of the area is printed.
Note: objects defined as constant (see RObject.setConstant()) will not be modified by the data source (RSource).
Method Summary | |
java.lang.String[] |
getFromFields()
field names in the linked RSource used for the relationship (this is normally the primary key in a table or record). |
RSource |
getLinkSource()
linked RSource (if the RSource supports nested RSources). |
java.lang.String[] |
getToFields()
field names in this RSource used for the relationship (this is normally a foreign key). |
void |
rsource_end()
called after printing all records. |
java.lang.Object |
rsource_getData(java.lang.String FieldName)
used to retrieve an element's value. |
boolean |
rsource_nextRecord()
used to require a new data record. |
boolean |
rsource_start()
called before printing the first record. |
void |
setFromFields(java.lang.String[] s)
field names in the linked RSource used for the relationship (this is normally the primary key). |
void |
setLinkSource(RSource l)
linked RSource (if the RSource supports nested RSources). |
void |
setParameter(java.lang.String param,
java.lang.String value)
sets a value for a parameter. |
void |
setToFields(java.lang.String[] s)
field names in this RSource used for the relationship (this is normally a foreign key). |
Method Detail |
public java.lang.Object rsource_getData(java.lang.String FieldName)
public boolean rsource_nextRecord()
public boolean rsource_start()
public void rsource_end()
public RSource getLinkSource()
public void setLinkSource(RSource l)
public java.lang.String[] getFromFields()
public java.lang.String[] getToFields()
public void setFromFields(java.lang.String[] s)
public void setToFields(java.lang.String[] s)
public void setParameter(java.lang.String param, java.lang.String value)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |