|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.crystaldecisions.sdk.occa.report.data.Rowset
public class Rowset
This object stores a set of rows from a table of data. The Rowset object is used to store
the raw data it has retrieved and filtered in a flat format. When the RAS SDK retrieves rows from the
RAS server, it does so in batches, which are of equal size except the last batch. A batch is only
retrieved when it is needed or when you explicitly state you want a batch. The batches are stored in
the RecordBatches object; access this collection using the Rowset.getRecordBatches()
method.
Use the RowsetController object's createCursor
method to create, navigate, and retrieve the rowset for a report. Note, however, that when you call this
function, it does not automatically retrieve all the record batches: it was intended to retrieve records
in batches. For example, it could be used to display a certain number of records per web page. To
retrieve record batches in the rowset, do the following:
RowsetController using the setBatchSize
method, and the number of batches to be cached in the cursor using the setNumOfCachedBatches method. createCursor method. moveTo method to fetch the batch that you want. getRecordCount
method, or when isEOF method returns true. RowsetBatchSize is 100, RecordCount is 500, and
NumOfCachedBatches is 2.
When reading the records in the batches, be aware that the records may be filtered or sorted and thus
the record keys may not be consecutive or may not be there at all: the row number, however, is always
consecutive. Use the Rowset.getIsRecordKeyConsecutive() method to determine whether the record keys
are in consecutive order or not. The batches that have been retrieved may also be stored in an XML
format. You may do this using the saveToXML method.
Note: When you save the data to XML only the data that has been retrieved is saved. This means that only a part of the record set may be saved if you have not retrieved all batches.
When possible, use the {IRowset} interface to manipulate this object.
| Constructor Summary | |
|---|---|
Rowset()
|
|
Rowset(IRowset src)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone(boolean deepClone)
|
void |
copyTo(java.lang.Object destObject,
boolean deepCopy)
|
java.lang.Object |
createMember(java.lang.String eleName,
org.xml.sax.Attributes attrs,
XMLSerializationContext ctxt,
java.util.Map objState,
boolean[] bLoaded)
For internal use only. |
void |
endElement(java.lang.String eleName,
java.util.Map objState)
For internal use only. |
int |
getBatchSize()
Returns the size of the record batches. |
int |
getFirstRecordKey()
Returns the key of the first record in the set. |
boolean |
getIsRecordKeyConsecutive()
Returns true if the record keys are consecutive, and false otherwise. |
boolean |
getIsTotalRecordKnown()
Returns true if the total number of records in the rowset is known, and false
otherwise. |
IRowsetMetaData |
getMetaData()
Returns the rowset's column headings. |
RecordBatches |
getRecordBatches()
Returns the record batches that have been retrieved. |
int |
getTotalRecordCount()
Returns the total number of rows in the rowset. |
java.lang.String |
getXMLData()
Returns a string that stores the data in the rowset in XML format. |
boolean |
hasContent(java.lang.Object srcRowset)
|
void |
loadFromXML(java.lang.Object xmlSource)
Loads data from an XML file into the rowset. |
void |
readElement(java.lang.String eleName,
java.lang.String sVal,
org.xml.sax.Attributes attrs,
java.util.Map objState)
For internal use only. |
void |
save(XMLWriter writer,
java.lang.String sTag,
XMLSerializationContext ctxt)
For internal use only. |
void |
save(XMLWriter writer,
XMLSerializationContext ctxt)
For internal use only. |
void |
saveContents(com.crystaldecisions.xml.serialization.XMLWriter writer,
com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
For internal use only. |
void |
saveToXML(java.lang.Object desination)
Saves the data in the RecordBatches collection to a file in XML format. |
void |
setBatchSize(int batchSize)
Sets the size of the record batches. |
void |
setFirstRecordKey(int recordKey)
Sets the key of the first record in the set. |
void |
setIsRecordKeyConsecutive(boolean isRecordKeyConsecutive)
Sets> if the record keys are consecutive. |
void |
setMetaData(IRowsetMetaData metaData)
Sets the rowset's column headings. |
void |
setRecordBatches(RecordBatches recordBatches)
Sets the record batches that have been retrieved. |
void |
setTotalRecordCount(int totalRecordCount)
Sets the total number of rows in the rowset. |
void |
setXMLData(java.lang.String source)
Sets the string that stores the data in the rowset in XML format. |
void |
startElement(java.lang.String eleName,
java.util.Map objState,
org.xml.sax.Attributes attrs)
For internal use only. |
void |
writeRowsetSchema(XMLWriter writer,
XMLSerializationContext ctxt,
java.lang.String schemaNamespaceTag)
For internal use only. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Rowset(IRowset src)
public Rowset()
| Method Detail |
|---|
public java.lang.Object clone(boolean deepClone)
public void copyTo(java.lang.Object destObject,
boolean deepCopy)
public java.lang.Object createMember(java.lang.String eleName,
org.xml.sax.Attributes attrs,
XMLSerializationContext ctxt,
java.util.Map objState,
boolean[] bLoaded)
For internal use only.
public void endElement(java.lang.String eleName,
java.util.Map objState)
For internal use only.
public int getBatchSize()
IRowsetReturns the size of the record batches.
getBatchSize in interface IRowsetint that specifies the size of the record batches.public int getFirstRecordKey()
IRowsetReturns the key of the first record in the set.
getFirstRecordKey in interface IRowsetint that specifies the key of the first record in the set.public boolean getIsRecordKeyConsecutive()
IRowset
Returns true if the record keys are consecutive, and false otherwise.
getIsRecordKeyConsecutive in interface IRowsettrue if the record keys are consecutive, and false otherwise.public boolean getIsTotalRecordKnown()
IRowset
Returns true if the total number of records in the rowset is known, and false
otherwise.
getIsTotalRecordKnown in interface IRowsettrue if the total number of records in the rowset is known, and false
otherwise.public IRowsetMetaData getMetaData()
IRowsetReturns the rowset's column headings.
getMetaData in interface IRowsetIRowsetMetaData object containing the rowset's column headings.public RecordBatches getRecordBatches()
IRowsetReturns the record batches that have been retrieved.
getRecordBatches in interface IRowsetRecordBatches object that contains the record batches that have been
retrieved.public int getTotalRecordCount()
IRowset
Returns the total number of rows in the rowset. If the total number of records is not known, this
number is 7FFFFFFF hex (2147483647 decimal).
getTotalRecordCount in interface IRowsetint that specifies the total number of rows in the rowset.
public java.lang.String getXMLData()
throws java.io.IOException
IRowset
Returns a string that stores the data in the rowset in XML format.
To save the XML data to a file use the saveToXML method.
getXMLData in interface IRowsetString that stores the data in the rowset in XML format.
java.io.IOExceptionpublic boolean hasContent(java.lang.Object srcRowset)
public void loadFromXML(java.lang.Object xmlSource)
throws java.io.FileNotFoundException,
java.io.IOException,
org.xml.sax.SAXException
IRowsetLoads data from an XML file into the rowset.
loadFromXML in interface IRowsetxmlSource - The path and filename of the XML file. In Java this may also be an InputStream.
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException
public void readElement(java.lang.String eleName,
java.lang.String sVal,
org.xml.sax.Attributes attrs,
java.util.Map objState)
For internal use only.
public void save(XMLWriter writer,
XMLSerializationContext ctxt)
throws java.io.IOException
For internal use only.
java.io.IOException
public void save(XMLWriter writer,
java.lang.String sTag,
XMLSerializationContext ctxt)
throws java.io.IOException
For internal use only.
java.io.IOException
public void saveContents(com.crystaldecisions.xml.serialization.XMLWriter writer,
com.crystaldecisions.xml.serialization.XMLSerializationContext ctxt)
throws java.io.IOException
For internal use only.
java.io.IOException
public void saveToXML(java.lang.Object desination)
throws java.io.IOException,
ReportSDKException
IRowset
Saves the data in the RecordBatches collection to a file in XML format.
When you save to XML only the record batches that have been retrieved from the server are saved. The XML format is ADO RecordSet compatible.
saveToXML in interface IRowsetdesination - An Object that specifies the path and filename of the XML file.
java.io.IOException
ReportSDKExceptionpublic void setBatchSize(int batchSize)
IRowsetSets the size of the record batches.
setBatchSize in interface IRowsetbatchSize - An int that specifies the size of the record batches.public void setFirstRecordKey(int recordKey)
IRowsetSets the key of the first record in the set.
setFirstRecordKey in interface IRowsetrecordKey - An int that specifies the key of the first record in the set.public void setIsRecordKeyConsecutive(boolean isRecordKeyConsecutive)
IRowsetSets> if the record keys are consecutive.
setIsRecordKeyConsecutive in interface IRowsetisRecordKeyConsecutive - true if the record keys are consecutive, and
false otherwise.public void setMetaData(IRowsetMetaData metaData)
IRowsetSets the rowset's column headings.
setMetaData in interface IRowsetmetaData - An IRowsetMetaData object containing the rowset's column headings.public void setRecordBatches(RecordBatches recordBatches)
IRowsetSets the record batches that have been retrieved.
setRecordBatches in interface IRowsetrecordBatches - A RecordBatches object that contains the record batches that have
been retrieved.public void setTotalRecordCount(int totalRecordCount)
IRowset
Sets the total number of rows in the rowset. If the total number of records is not known, this
number is 7FFFFFFF hex (2147483647 decimal).
setTotalRecordCount in interface IRowsettotalRecordCount - An int that specifies the total number of rows in the rowset.
public void setXMLData(java.lang.String source)
throws java.io.IOException
IRowset
Sets the string that stores the data in the rowset in XML format.
To save the XML data to a file use the saveToXML method.
setXMLData in interface IRowsetsource - A String that stores the data in the rowset in XML format.
java.io.IOException
public void startElement(java.lang.String eleName,
java.util.Map objState,
org.xml.sax.Attributes attrs)
For internal use only.
public void writeRowsetSchema(XMLWriter writer,
XMLSerializationContext ctxt,
java.lang.String schemaNamespaceTag)
throws java.io.IOException
For internal use only.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||