on 01-27-2005 12:21 PM
I need to read the data of a "Withholding tax report" to print a document. There only 4 visible rows all the other rows are collapsed; but my add-on needs the hidden rows, and don't want to depend on wether the user has pressed the expand button or not.
Hello Jurgen,
What about accessing that form (Withholding tax report) get the matrix object and then with property "RowCount" you can get the number of lines of the report even when they are hidden. After that you can iterate through all of them.
If you want to get the number of lines that are displayed in the GUI(with out taking into consideration the hidden ones) you can use property "VisualRowCount".
Hope this helps,
Felipe Ortega
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This I tried (of course) but sap cannot handle a rowcount index larger than the visualrowcont.
Example
This code works fine:
string tmp;
SAPbouiCOM.Item oItem = oForm.Items.Item("some_grid");
SAPbouiCOM.Cells oAmountCells = ((SAPbouiCOM.Columns)((SAPbouiCOM.Matrix)oItem.Specific).Columns).Item("5").Cells; //5th column
iRows = ((SAPbouiCOM.Matrix)oItem.Specific).VisualRowCount;
for (int i=1; i<=iRows; i++)
{
tmp = ((SAPbouiCOM.EditText)oAmountCells.Item(i).Specific).String;
}
But if you change
iRows = ((SAPbouiCOM.Matrix)Item.Specific).VisualRowCount;
into
iRows = ((SAPbouiCOM.Matrix)Item.Specific).RowCount;
the code will crash if you reach an index larger then the VisualRowCount.
Moreover you will never see a value in "tmp" of a row that isn't displayed.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.