How to add a row of data to the TreeListView and then add a subdata to the row? - objectlistview

How to add a row of data to the TreeListView control and then add a subdata to the row?
TreeListViewControlTest_c#2010.zip (download link - Dropbox)

Related

ClosedXML: Is there a way of finding the worksheet position of a table row

Using ClosedXML to insert data into an existing Excel document, I need to move the part of the worksheet under a table down for a number of rows by inserting rows into the worksheet, not into the table.
Is there a way to find the row number N in the respective worksheet for a table row, which one gets e.g. by IXLTable.LastRow(), such, that IXLWorksheet.Row(N) will point to the row, in which the table's last row is contained?
Use IXLTable.LastRow().RowNumber() to get the row number.

When a row is added to one sheet, automatically add a row to another sheet

For Example: If I add a row between rows 1 & 2 in Excel sheet 1 then how can I reflect this change automatically in sheet 2?
Sheet 1
Sheet 2
You can use VLOOKUP function for that. First column of your Spreadsheet 2 will show first column of Spreadsheet 1 , same for the 2nd column
This is your first sheet you can change content of A and B column however you want.
For the Second Sheet add following functions
Column A - =IFERROR(VLOOKUP(Sheet1!$A$1:$A$1000, Sheet1!$A$1:$B$1000, 1, false), "")
Column B - =IFERROR(VLOOKUP(Sheet1!$A$1:$A$1000, Sheet1!$A$1:$B$1000, 2, false), "")
Now all changes from Sheet 1 will be shown in Sheet 2
On a worksheet, make a list of your names and convert the list to a table by highlighting the header and the values, press CTRL+T, give your table a name. While you still have a cell in the table selected...
On the ribbon, select Data > Get & Transform > From Table
The Power Query editor will launch in a new window and you will see the table displayed. You now have a query table. Change the name of the query. When you change the name of the query in the query settings panel on the right, it will update the name of the query in the query navigation panel on the left.
Add an index column. Go to Add Column > Index Column > From 1.
Now you have a dynamic index column attached to the names column. Go to File > Close and Load To
The query editor window will close and the Load To dialogue box will be displayed. Select Table > New Worksheet, Load to Data Model > Load.
Your query table will now be displayed on a new worksheet in your workbook. You can change the formatting on the Design tab of the ribbon.
Now, any changes you make to the original table are synced, all you have to do is refresh (Data > Refresh, from the ribbon or by right-clicking on the query table).
Try it out. Add a new name to the bottom of the data table, then go to the query table, right-click > data > refresh.

Excel filtering rows and columns

I have data in rows and columns for either H or M or L and I want to filter out any Hs that are in the rows and columns. Only problem is the row has a main heading and then a sub heading. Any ideas please how I do this?
Highlight the whole table except for the Main Heading row.
Click Insert->Table
Make sure "My table has headers" is checked.
You'll then be able to filter each of the columns using the Sub Header drop downs.
Alternatively click Data->Filter and filter out the H's. The Sub Headers will show up as data values though...

Applying Multiple Value Filters in Excel Pivot

Using Excel 2013, I would like to apply a Top 10 Filter to a pivot and also apply a filter to an additional values field. Is this possible?
I would like to filter off all 1's from Sum of Individual Claims Column, but still have the top 10 by average of % of claims (minus the claim volumes that were only 1).
Table 1 with 1's in Sum of Individual Claims Column
The resulting table should look like this.
I found a workaround to use multiple filters in a pivot table, by using a helper column in the source data. Here is a step by step approach you can adjust for your needs.
Step 1: Add Helper Columns to the data source with a new heading and any constant value in every row. (You need one helper column per extra filter. If you want to use 2 filters, you need one helper column)
Step 2: Add the Helpercolumn attributes to your row-fields of the pivot table.
Step 3: Choose the tabular layout where all row attributes are in one row.
Step 4: Now you can apply different filters, one for each attribute in the row-field. In your case: the top 10 filter for the "Heading 1" and an unequal filter to "Help 1". This will yield the same result as if you use multiple filters for the "Heading 1".
Step 5: If you now apply this to VBA, the code could look like this:
Dim pvt As PivotTable
Set pvt = ActiveSheet.PivotTables("PivotTable1")
ActiveSheet.PivotTables("PivotTable1").AllowMultipleFilters = True
With pvt.PivotFields("Heading 1")
.ClearAllFilters
.PivotFilters. _
Add2 Type:=xlTopCount, DataField:=ActiveSheet.PivotTables("PivotTable1"). _
PivotFields("Average of Heading 2"), Value1:=10
End With
With pvt.PivotFields("Help 1")
.ClearAllFilters
.PivotFilters.Add2 _
Type:=xlValueDoesNotEqual, DataField:=ActiveSheet.PivotTables("PivotTable1" _
).PivotFields("Sum of Heading 3"), Value1:=1
End With
If you need to apply multiple value filters to the same field in a pivot table, the easiest way to do that is as follows:
Add a column with identical values to the Source Data and add an index to its name. E.g. I had Hospital column and created its clone named Hospital 2
Change the Source Data to make sure the new column is included.
Refresh your pivot.
Put the new column clone (i.e. Hospital 2 in our case) into ROWS window of the PivotTable Fields tab.
Make sure that all fields in Columns window in PivotTable Fields tab have the following settings:enter image description here
Now you can apply 2 different value filters to the old and new identical columns!!!
If you don't need to see the newly added clone column, just hide it.
That's it!!!
Add Individuals Claims to the Filters pane in the Pivot Fields Area.
A filter will appear in your above your Pivot table. Add unselect the value 1.
Now go to the Row Labels dropdown button and select Value Filters, then Top N...:
In the highlighted in red option select your Average of % of Claims measure.

Applescript + InDesign Selecting Body Rows In Table

I am currently trying to automate some data formatting. The source data is formatted in Excel. The inDesign template is already formatted. I can right click the table and select body rows then paste the data and it looks beautiful. I am looking to remove this step but am unable to figure out how to get applescript to select the table and body rows of the inDesign template.
Neither of the following seem to work.
set selection to body rows of table 1 of active document
select body rows of table 1 of active document
Any help on this would be great.
Unfortunately the select command only works for a single row, and not all of the rows in a selected table.
Essentially, you must go row by and decide the row type. Once you've decided the row is a body row, you can select it.
The syntax for adding a selected row to another selected row is super tricky, especially without an example. See the complete script below.
tell application "Adobe InDesign CC 2015"
set allBodyRows to every row of every table of every story of active document whose row type is body row
set bodyRow to {}
repeat with i from 1 to (count allBodyRows)
set bodyRow to item i of allBodyRows
if i = 1 then
select bodyRow
else
select bodyRow existing selection add to
end if
end repeat
end tell
I think you need to reference your table differently. Try this:
set allTables to every table of every story of active document
set myTable to item 1 of allTables
Then you should be able to select rows:
tell table myTable
select first row
end tell
--author by RyuAutodidacte
tell application "Adobe InDesign 2020"
tell active document
--When the selection is a text frame
set FirstBodyCell to index of first cell of table 1 of selection whose row type is body row
set LastBodyCell to index of last cell of table 1 of selection whose row type is body row
select cells FirstBodyCell thru LastBodyCell of table 1 of selection
end tell
end tell

Resources