엑셀추출
- BitoB
import 'PMLFileBrowser'
handle Any
endhandle
import |GridControl|
handle ANY
endhandle
using namespace 'Aveva.Core.Presentation'
!Browser = object PMLFileBrowser('SAVE')
!Browser.Show( )
!Browser.Show( 'C:', 'report' , 'Save File' ,false, 'Excel Documents|*.xlsx', 1)
!Savefile = object file(!browser.file())
$* !siteList = !!collectAllFor( 'Bran Mem','', CE)
!siteList = !!collectAllFor( 'Bran Mem','', WORL)
!header = object array()
!header[1] = 'SITE'
!header[2] = 'ZONE'
!header[3] = 'PIPE'
!header[4] = 'BRAN'
!header[5] = 'NAME'
!header[6] = 'P1BORE'
!header[7] = 'P2BORE'
!header[8] = 'P3BORE'
!i = 1
DO !site values !siteList
!branMemlist = !!collectAllFor( 'Bran Mem','', !SITE)
!resultList = object array()
!ii = 1
DO !bran values !branMemlist
SKIP IF(!bran.TYPE.EQ(|ATTA|))
SKIP IF(!bran.TYPE.EQ(|WELD|))
!resultList[!ii][1] = NAME OF SITE OF $!bran
!resultList[!ii][2] = NAME OF ZONE OF $!bran
!resultList[!ii][3] = NAME OF PIPE OF $!bran
!resultList[!ii][4] = NAME OF BRAN OF $!bran
!resultList[!ii][5] = !bran.FULLNAME
!resultList[!ii][6] = !bran.PPBO[1].STRING()
!resultList[!ii][7] = !bran.PPBO[2].STRING()
HANDLE Any
!resultList[!ii][7] = ||
endhandle
!resultList[!ii][8] = !bran.PPBO[3].STRING()
HANDLE Any
!resultList[!ii][8] = ||
endhandle
!ii = !ii + 1
ENDDO
!grid = object NETGRIDCONTROL()
!nds = object NETDATASOURCE('GridControl', !header, !resultList)
!grid.bindToDataSource(!nds)
if !grid.getNumberRows().eq(0) then
skip
else
!savename = !Savefile.string()
!grid.saveGridToExcel(!savename.replace(|.xlsx|, !i.STRING() + |.xlsx|))
endif
!i = !i + 1
ENDDO