![]() |
Business Internet Services |
|
The StringMatrix tag contains a number of utility methods that are used to manipulate manipulate String[][] objects. In the next example assume that a set of records was pre-ordered on a specified
col (during a database query). In this case there are groups of rows that all have
that same col value. The StringMatrix is used to find the index where each group
begins and the number of rows in each group sequence. It also creates a new matrix
that contains labels whos values come form the group col values. The resulting
objects can be used to print the records using LoopSet tags. See the method colGroups()
below for more info and the classes listed below to see how to print them.
The indexes will be stored in an int[][] array of size int[n][2] array where n is
the number of groups. The value of int[n][0] specifies the index where each group begins
and the value of int[n][1] specifies how many succeding rows are in that group.
Note that the colGroups can operate on multiple MatrixParameter objects if there are multiple store paramters (comma delimited list) to specify the name each result is stored under. You can also compute lineitem subtotals and a grand total on a single matrix.
In the example below the column attribute of the MatrixParameter now contains 2 index
values. The first one define the col to group by and the following value(s) indicate
the cols to sum. See the method sumColGroups() for more info.
In the next example the ArrayParameter tag defines an array of colors that can be
put into a matrix of records for display by a LoopSet. The alternating rows
of the displaySet will have alternating color values in the new column.
Multiple ArrayParameter tags can be used with a mix of hard coded and paramter values.
In the next example an Rp tag and a Param tag are used to add a col values
to a MatrixParameter. The Rp and Param tag only return single values so every row
in the col created for an Rp or Param tag will contain the same value.
@author Mark Ashworth @version 0.1, 2001-04-24 Return to Index Note: We have tried to test all of the code examples but they may contain errors. Any questions, comments, suggestions, or problems should be sent to info@plands.com. |
|
© 2005 Planetary
Data Systems.
All rights reserved. |