Hi Experts,
I would like to read an excel file like dataframe in PML then,Know how many rows and Columns are existing the excel
Chnage the value of the column with x1.5 times and assign as Attribute in design
Hi Experts,
I would like to read an excel file like dataframe in PML then,Know how many rows and Columns are existing the excel
Chnage the value of the column with x1.5 times and assign as Attribute in design
Sri Hi, you can use the netgridcontrol().
Here a simple sample :
define method .loadFromExcel()
import 'PMLFileBrowser'
Handle Any
Endhandle
using namespace 'Aveva.Pdms.Presentation'
!browser = object PMLFileBrowser('OPEN')
!browser.show('C:\','','Load Grid from Excel',true, 'Excel Documents|*.xls',1)
!this.grid.clearGrid()
!nds = object NetDataSource('Grid Control Example', !browser.file())
!this.grid.BindToDataSource(!nds)
endmethod
Tell me if you need more, but idk your programmer level.
I wish count the row and column from The function
Sri , Ok, well then try this :
import 'PMLFileBrowser'
Handle Any
Endhandle
import 'GridControl'
handle any
endhandle
-- PDMS
--using namespace 'Aveva.Pdms.Presentation'
-- E3D
using namespace 'Aveva.Core.Presentation'
!browser = object PMLFileBrowser('OPEN')
!browser.show('C:\','','Load Grid from Excel',true, 'Excel Documents|*.xlsx',1)
!nds = object NetDataSource('Grid Control Example', !browser.file())
!grid = object NetGridControl()
!grid.BindToDataSource(!nds)
q var !grid.GETCELL(2,2)
-- show your rows
q var !grid.GETROWS()
-- show your columns
q var !grid.GETCOLUMNS()
Result :
All the methods can be shows up by using .methods()
Like :
q var !grid.methods()
or
q var !nds.methods()
Thank you for this Code yann gueguen
Im trying to read particular .xlsx directly which will be always stored in below path
C:\Users\Desktop\macro\xlsx\lines.xlsx
above syntax is opening the file browser. is there any syntax
Thank you for the understanding
This example is so useful and can read any excel file and collect all the data stored.
Based on te code above, user will be prompted to pick an excel file. May I know how to find out the file name that was pickup from the file folder?
LT
Hello Luke,
I think the code to get the file name is the following
q var !browser.file()
https://help.aveva.com/AVEVA_Everything3D/1.1/NCUG/wwhelp/wwhimpl/common/html/wwhelp.htm#href=NCUG8.html&single=true