Seal Report Forum
»
Report Edition
»
Reports
»
How to get column number if column name is provided
Rank: Newbie
Groups: Registered
Joined: 12/26/2019(UTC) Posts: 6 Location: Mumbai
|
If I want to get a value of particular cell then we use following script code table[10, 2].DisplayValue
It is difficult to remember the column number. Is there a way to use column name instead of column number? Or Can I get column number if column name is provided.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
You can use (which use the first row of the table): Code:
/// <summary>
/// Returns the column number from the element column name. -1 if not found.
/// </summary>
public int GetCol(string elementName)
or for display name, you can try: Code:var line = page.DataTable.Lines[0]; //For row 0
var col = Array.FindIndex(line, i => i.Element != null && i.Element.DisplayName == "column name");
Edited by user Monday, January 20, 2020 9:07:14 AM(UTC)
| Reason: Not specified
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
How to get column number if column name is provided
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.