Hi, Please, i need your help to create tables for the screen and/or to print. I have us xml file. The probleme is, how i get the page-length/ligne-number/items On the end i would transform this scripte to the html format with : "$Create.WriteLine" Thanks for you help My best regards Arnold Firstly i createt the nestet loops to see the probleme: ======================================== cls $items = 1250 #test
$HEADER = 0 $LIGNE = 8 $PAGE_l = 70"""<top>" for ($PAGE = 1; $PAGE -lt [int]($items / $PAGE_l); $PAGE++) {"""<page> = $PAGE""" for ($HEADER = 1; $HEADER -ne 10; $HEADER++) {" <header 2> = $HEADER" #if($HEADER -lt 10){"<bootom>"} for ($LIGNE = 1; $LIGNE -lt 8; $LIGNE++) {" <ligne> = $LIGNE" } } }"" ============================= and with the first test i would creat the table to show it on the screen and/or to print. ============================= cls $XPath = "C:\test\reconnect.xml" $XConnexions = New-Object System.XML.XMLDocument [xml]$XConnexions = Get-Content $XPath $XNbr_ligne = @($XConnexions.reconnect.city).Count + 1"?????? $Xitems = $XNbr_ligne $XHEADER = 0 $XLIGNE = 8 $XPAGE_l = 70 $XHeader_1 = "$(Get-Date –f o)" $XHeader_2 = '<L-Nbr>','<Name>','<Visite2013>','<Visite2014>' for ($XNbr = 1; $XNbr -lt $XNbr_ligne[1..$XNbr_ligne]; $XNbr ++ ) { $XName = $XConnexions | select-xml "/reconnect/city/name[preceding-sibling::NR='$XNbr']" | % {$_.Node.InnerText} $XVisite2013 = $XConnexions | select-xml "/reconnect/city/Visite2013[preceding-sibling::NR='$XNbr']" | % {$_.Node.InnerText} $XVisite2014 = $XConnexions | select-xml "/reconnect/city/Visite2014[preceding-sibling::NR='$XNbr']" | % {$_.Node.InnerText} $XHeader_1 Import-Clixml -Path $XPath -Delimiter ' ' -Header $XHeader_2 |` Select-Object -Skip 1 -descending $XVisite2014 | % ` { for ($XPAGE -lt [int]($Xitems / $XPAGE_l); $XPAGE ++ ) { """<page> = $XPAGE""" for ($XHEADER = 1; $XHEADER -ne 10; $XHEADER++) {" <$XHeader_2 - 2> = $XHEADER" for ($XLIGNE = 1; $XLIGNE -lt 8; $XLIGNE++) {" <ligne> = "$XLIGNE $XName; $XVisite2013; $XVisite2014; $_} } } } }
↧
creat custom table
↧