Adamguy Posted December 10, 2017 Share Posted December 10, 2017 Hi All I'm having difficulties with my Array. i have it reading an excel .csv and i have set the $iFlags to 65 (64, 1). the issue is that my headings show up as the set default "Col 0 | Col 1 | ..." if i was to set the $sflags to 0 my headings are fine but it displays the data incorrectly, can someone please help me or link me to some helpful information about this, i cant seem to find anything that suits my needs, or even an alternative, I'm kind of a newbie to Auto i.t and my intention is to create a Gui that reads a spread sheet and displays the data. thanks! Adam code attached. project.au3 Link to comment Share on other sites More sharing options...
Adamguy Posted December 10, 2017 Author Share Posted December 10, 2017 #include <File.au3> #include <Excel.au3> #include<MsgBoxConstants.au3> #Include <Array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Local $bVisible = True local $Spreadsheetlocation = "C:\spreadsheet location Local $oExcel = _excel_open($bVisible = False) Local $oWorkBook = _Excel_BookOpen ( $oExcel, $Spreadsheetlocation) $aArray = $oExcel.Activesheet.Range("A:D").Value #include <Array.au3> local $heading = "Job Title | AffectedUser | Description | DateCreated " Local $iflags = 65 _ArrayDisplay ( $aArray ,"Jobs Logged" ,"|3" , $iflags ,Default , $heading , Default , Default, Default) code - Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 10, 2017 Moderators Share Posted December 10, 2017 Adamguy, Welcome to the AutoIt forums. The problem is caused by you transposing the array as you display it. The internal logic of the UDF says that if you transpose the array then the columns are now rows and so the headers are no longer required. So you need to transpose your array before you display it: #include <Array.au3> Global $aArray[][] = [["Title 1", "Title 2", "Title 3", "Title 4"], _ ["User 1", "User 2", "User 3", "User 4"], _ ["Descript 1", "Descript 2", "Descript 3", "Descript 4"]] Local $heading = "Job Title | AffectedUser | Description | DateCreated " Local $iflags = 64 ; Do not add the transpose flag here _ArrayTranspose($aArray) _ArrayDisplay($aArray, "Jobs Logged", Default, $iflags, Default, $heading) M23 Adamguy 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Adamguy Posted December 11, 2017 Author Share Posted December 11, 2017 On 12/11/2017 at 0:27 AM, Melba23 said: Adamguy, Welcome to the AutoIt forums. The problem is caused by you transposing the array as you display it. The internal logic of the UDF says that if you transpose the array then the columns are now rows and so the headers are no longer required. So you need to transpose your array before you display it: #include <Array.au3> Global $aArray[][] = [["Title 1", "Title 2", "Title 3", "Title 4"], _ ["User 1", "User 2", "User 3", "User 4"], _ ["Descript 1", "Descript 2", "Descript 3", "Descript 4"]] Local $heading = "Job Title | AffectedUser | Description | DateCreated " Local $iflags = 64 ; Do not add the transpose flag here _ArrayTranspose($aArray) _ArrayDisplay($aArray, "Jobs Logged", Default, $iflags, Default, $heading) M23 thanks so much, know what im doing now!! 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