MVP 2023 Flex727 Posted February 8, 2019 MVP 2023 Report Share Posted February 8, 2019 I have a large Data Table (Indexed) that I need to rearrange the columns. According to the online tutorial that can be done, but it doesn't explain how. It also doesn't seem to be addressed in the Help file. None of the common sense ways seem to work. Anyone know how to do this in UniLogic? Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted February 8, 2019 MVP 2023 Report Share Posted February 8, 2019 Duplicate column to new position + delete column+ rename new column. Export to excel file + rearrange + import to Data Table . Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted February 8, 2019 Author MVP 2023 Report Share Posted February 8, 2019 4 minutes ago, kratmel said: Duplicate column to new position + delete column+ rename new column. Adding or duplicating always adds to the end. Am I missing something? Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted February 8, 2019 MVP 2023 Report Share Posted February 8, 2019 Sorry it was applicable only in standard (visilogic like non indexed) Data table. Maybe create new DTI with diferent column arangement and use LF: Copy Column to Column in DTI. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted February 8, 2019 Author MVP 2023 Report Share Posted February 8, 2019 1 minute ago, kratmel said: use LF: Copy Column to Column in DTI. It's not the data in the table I'm concerned with. I just want the table itself rearranged. It's large and complex and I don't want to have to create it over again. Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted February 9, 2019 MVP 2023 Report Share Posted February 9, 2019 I try to Export struct to excel file + rearrange by insert blank rows and copy past or cut paste (i tryed to add rows with column name and data type in *.xls manualy also) + import to struct . Maybe it not simple but it works. Another solution is to duplicate all Member in needed sequence and after duplicating delete all source Member. This is not correct Member = Member1 after duplicate. But this method not need export import operation. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 9, 2019 MVP 2023 Report Share Posted February 9, 2019 4 hours ago, kratmel said: I try to Export struct to excel file + rearrange by insert blank rows and copy past or cut paste That was the only solution I was able to come up with as well. When I imported the Excel file it re-arranged my Test1 Struct and the column order in the data table changed. I chose "Copy and Replace" on the import option. I've attached the original export as well as my shuffled one. Joe T. DataTable.xls DataTable1.xls Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted February 9, 2019 Author MVP 2023 Report Share Posted February 9, 2019 6 hours ago, Joe Tauser said: That was the only solution I was able to come up with as well. Thank you both @kratmel and @Joe Tauser - that seemed to work. Link to comment Share on other sites More sharing options...
Saragani Posted February 10, 2019 Report Share Posted February 10, 2019 Well, the re-ordering is not in the Data Table itself, but in the HMI elements (you can have 2 different views to the same table, one with only some columns visible and ordered in one way, and the other one in a different screen for example, with different columns and ordered differently). Just place a Data Table element on a screen, link it to a table, and open the "Columns Widths" property. In that view, you have "Is Visible" checkbox for each column. You also have the last columns (without title). where hovering your mouse on a row will show a drag image (4 horizontal lines). By dragging from it then you can drop it on a different index (you will see the orange line adorner), and this will re-order the columns for that widget. Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted February 10, 2019 MVP 2023 Report Share Posted February 10, 2019 8 hours ago, Saragani said: the re-ordering is not in the Data Table itself, but in the HMI elements I tested it, in table on HMI rearrangement is possible.But on this topic, we have developed a way to do this in the table STRUCTS. It is very uncomfortable to look for the required column for comparison with another column. Sometimes the table is not present and is not required on the HMI screen. At least in visilogic it is possible to duplicate column to the desired position. Perhaps creators can add this feature in future versions of the UniLogic. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted February 10, 2019 Author MVP 2023 Report Share Posted February 10, 2019 9 hours ago, Saragani said: Just place a Data Table element on a screen, link it to a table, and open the "Columns Widths" property. In that view, you have "Is Visible" checkbox for each column. You also have the last columns (without title). where hovering your mouse on a row will show a drag image (4 horizontal lines). Thank you, @Saragani. Is this feature also available for the Web Server? Link to comment Share on other sites More sharing options...
Saragani Posted February 10, 2019 Report Share Posted February 10, 2019 Yes. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted February 11, 2019 Author MVP 2023 Report Share Posted February 11, 2019 Thanks! Link to comment Share on other sites More sharing options...
Robin P Posted February 13, 2019 Report Share Posted February 13, 2019 I have successfully used Export Structs to get an XLS spreadsheet, shuffled its rows (fields) using Excel's Cut and Insert Cut Cells, then used Import Structs to overwrite the original struct. I recommend saving a copy of the file beforehand, and not attempting to add, remove or rename any fields from Excel. I did indulge in some renaming which imported OK, but got a Delegate Error on recompiling - which spells death to the ULPR I think. Renaming struct fields seems fine if done within Unilogic. Link to comment Share on other sites More sharing options...
Oldskuler Posted April 22, 2019 Report Share Posted April 22, 2019 You can simply do that in Properties Window of your Data Table, under Columns widths (Colection). It is a drag and drop option. Cheers, Petar Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now