Skip navigation
Nashreen Banu
Currently Being Moderated

can anyone please help me in doing it

Feb 18, 2014 6:42 AM

How to export a gridview data into excel in excel 2007 format(xlsx) using actionscript 3? Will the actionscript 3 support xlsx?

 

The below code is written in actionscript 3 which exports the populated griddata into excel in excel 2003 format(.xls). I need the populated data to be exported to excel 2007 format(.xlsx).

 

Please give some solutions to get it exported in excel 2007 format.

 

if (Settings.getToolType() == CompaClass.TOOL_COMPATIBILITY) {

               

                lb_c = new PushButton(this, 80, 140, "Legend", showLegendMenu);

                lb_c.width = 50;

                addChild(lb_c);

               

                nlb = new PushButton(this, 5, 140, "Export to XL", exportToXLS);

                nlb.width = 70;

                addChild(nlb);

 

                       

                var plusContainer: Sprite = new Sprite();

                var plus: Bitmap = new Plus() as Bitmap;

                var minusContainer: Sprite = new Sprite();

                var minus: Bitmap = new Minus() as Bitmap;

   

                plusContainer.addChild(plus);

                plusContainer.x = 135;

                plusContainer.y = 146;

                minusContainer.addChild(minus);

                minusContainer.x = 150;

                minusContainer.y = 146;

               

                addChild(plusContainer);

                addChild(minusContainer);

               

                plusContainer.addEventListener(MouseEvent.MOUSE_DOWN, this.onExpandAll);

                minusContainer.addEventListener(MouseEvent.MOUSE_DOWN, this.onCollapseAll);

               

                //this.addEventListener(MouseEvent.MOUSE_OVER, this.expandCornerView);

                //this.addEventListener(MouseEvent.MOUSE_OUT, this.resetCornerView);

            } else if (Settings.getToolType() == CompaClass.TOOL_RELEASE)

            {

                lb_c = new PushButton(this, 110, 140, "Legend", showLegendMenu);

                lb_c.width = 50;

                addChild(lb_c);

               

                nlb = new PushButton(this, 35, 140, "Export to XL", exportToXLS);

                nlb.width = 70;

                addChild(nlb);

                

            } else

            {

                var lb_r: PushButton = new PushButton(this, 50, 140, "Legend", showLegendMenu);

                lb_r.width = 70;

                addChild(lb_r);

            }

            le = new Legends();

            le.x = 5;

            le.y = 140;

            addChild(le);

        }

        public function expandCornerView(e: Event): void

        {

            if (this.header.textWidth > this.header.width)

            {

                this.header.width = this.header.textWidth + 15;

                this.width = 300;

            }

        }

       

        public function resetCornerView(e: Event): void

        {

            this.header.width =  150;

            this.width = 170;

        } 

       

        public var compaClass : CompaClass;

        public var xlsStr : String;

        public var fr:FileReference = new FileReference();

       

        public function XmlExportComplete(e: Event): void

        {

            fr.removeEventListener(Event.COMPLETE, XmlExportComplete);

            fr.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);

           

            Alert.show(Settings.reportName +" is successfully saved in Excel 2007 format."+"\n"+"\n"+"Please Note:- "+"\n"+"The Exported Matrix is best viewed with MS-Excel 2007 (or) above.");

        }

       

        public function exportToXLS(e: MouseEvent): void

        {

             if (Settings.getToolType() == CompaClass.TOOL_COMPATIBILITY)

             {

                 if(this._isExpandAll)

                 {

                     prepareXML();

                    //

                      //need to include code for export to excel hit rates.

                    //

                   

                    fr.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);

                    fr.addEventListener(Event.COMPLETE, XmlExportComplete);

                    fr.save(xlsStr, Settings.reportName.toString()+".xls");

                   

                 }else

                 {

                     Alert.show("Please expand the Matrix completely by clicking + and try 'Export to XL'");

                 }

             }else if (Settings.getToolType() == CompaClass.TOOL_RELEASE)

             {

                 prepareXMLforRel();

                

                 fr.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);

                fr.addEventListener(Event.COMPLETE, XmlExportComplete);

                fr.save(xlsStr, Settings.reportName.toString()+".xls");

             }                

        }       

       

        public function prepareXMLforRel():void {

            xlsStr = "";

            xlsStr+='<?xml version="1.0"?>\n';

            xlsStr+='<?mso-application progid="Excel.Sheet"?>\n';

            xlsStr+='<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"\n';

            xlsStr+='  xmlns:o="urn:schemas-microsoft-com:office:office"\n';

            xlsStr+='  xmlns:x="urn:schemas-microsoft-com:office:excel"\n';

            xlsStr+='  xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"\n';

            xlsStr+='  xmlns:html="http://www.w3.org/TR/REC-html40">\n';

            xlsStr+=' <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">\n';

            xlsStr+='  <Author>Compatibility Matrix Flash Tool</Author>\n';

            xlsStr+='  <LastAuthor>Compatibility Matrix Flash Tool</LastAuthor>\n';

           

            var rd: Date = Settings.reportDate;

            var xlsReportDate:String;

            xlsReportDate = rd.getFullYear().toString()+"-"+(rd.getMonth()+1).toString()+"-"+rd.g etDate().toString()+"T00:00:00Z";

            xlsStr+='  <Created>'+xlsReportDate+'</Created>\n';

           

            xlsStr+='  <Company>Nokia Siemens Networks</Company>\n';

            xlsStr+='  <Version>2.00</Version>\n';

            xlsStr+=' </DocumentProperties>\n';

            xlsStr+=' <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">\n';

            xlsStr+='  <WindowHeight>11190</WindowHeight>\n';

            xlsStr+='  <WindowWidth>18735</WindowWidth>\n';

            xlsStr+='  <WindowTopX>360</WindowTopX>\n';

            xlsStr+='  <WindowTopY>300</WindowTopY>\n';

            xlsStr+='  <ProtectStructure>False</ProtectStructure>\n';

            xlsStr+='  <ProtectWindows>False</ProtectWindows>\n';

            xlsStr+=' </ExcelWorkbook>\n';

            xlsStr+=' <Styles>\n';

            xlsStr+='  <Style ss:ID="Default" ss:Name="Normal">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom"/>\n';

            xlsStr+='   <Borders/>\n';

            xlsStr+='   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>\n';

            xlsStr+='   <Interior/>\n';

            xlsStr+='   <NumberFormat/>\n';

            xlsStr+='   <Protection/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s63">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s64">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s66">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9" ss:Bold="1"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s67">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders/>\n';

            xlsStr+='   <Font ss:FontName="Arial" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s68">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" ss:Color="#FFFFFF" x:Family="Swiss" ss:Size="9" ss:Bold="1"/>\n';

            xlsStr+='   <Interior ss:Color="#666666" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s69">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial"  ss:Bold="1" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#989898" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s691">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" ss:Size="9" />\n';

            xlsStr+='   <Interior ss:Color="#BBBBBB" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            //dotted lines in release calender week no.s

            xlsStr+='  <Style ss:ID="dottedLine">\n';

            xlsStr+='     <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

               xlsStr+='     <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='      <Border ss:Position="Left" ss:LineStyle="Dash" ss:Weight="1" ss:Color="#808080"/>\n';

               xlsStr+='     </Borders>\n';

               xlsStr+='     <Font ss:FontName="Arial" ss:Size="9"/>\n';

               xlsStr+='     <Interior ss:Color="#BBBBBB" ss:Pattern="Solid"/>\n';

              xlsStr+='   </Style>\n';

            xlsStr+='  <Style ss:ID="s692">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#DDDDDD" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s693">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#009966" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s72">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s74">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s75">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s76">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s761">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#CDCDCD" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#FFC000" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s77">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s79">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Color="#C0C0C0" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Color="#C0C0C0" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Color="#C0C0C0" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Color="#C0C0C0" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#000000" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s80">\n';

            xlsStr+='   <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9" ss:Color="#FF0000"\n';

            xlsStr+='    ss:Bold="1"/>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s81">\n';

            xlsStr+='   <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="11"/>\n';

            xlsStr+='   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s82">\n';

            xlsStr+='   <Alignment ss:Vertical="Bottom" ss:Rotate="90"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s83">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Color="#FFFFFF" ss:Size="9" ss:Bold="1"/>\n';

            xlsStr+='   <Interior ss:Color="#666666" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s84">\n';

            xlsStr+='   <Borders/>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s89">\n';

            xlsStr+='   <Borders />\n';

            xlsStr+='   <Interior ss:Color="#666666" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s891">\n';

            xlsStr+='   <Borders />\n';

            xlsStr+='   <Interior ss:Color="#989898" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s892">\n';

            xlsStr+='   <Borders />\n';

            xlsStr+='   <Interior ss:Color="#BBBBBB" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s893">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#CDCDCD" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s8931">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:Color="#FFFFFF" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#00FF00" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s85">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s86">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9" ss:Bold="1"/>\n';

            xlsStr+='   <Interior ss:Color="#989898" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s861">\n';

            xlsStr+='   <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9" ss:Bold="1"/>\n';

            xlsStr+='   <Interior ss:Color="#BBBBBB" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s862">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#DDDDDD" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s863">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9"/>\n';

            xlsStr+='   <Interior ss:Color="#009966" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s87">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s871">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#FFC000" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s879">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#FF0000"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#000000" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s109">\n';

               xlsStr+='    <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>\n';

               xlsStr+='    <Borders/>\n';

               xlsStr+='    <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Bold="1"/>\n';

               xlsStr+='    <Interior ss:Color="#FE9016" ss:Pattern="Solid"/>\n';

              xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s110">\n';

               xlsStr+='   <Interior ss:Color="#FE9016" ss:Pattern="Solid"/>\n';

              xlsStr+='  </Style>\n';

              xlsStr+='  <Style ss:ID="s67ch">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#CDCDCD"/>\n';

            xlsStr+='    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#CDCDCD"/>\n';

            xlsStr+='    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#CDCDCD"/>\n';

            xlsStr+='    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='     ss:Color="#CDCDCD"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#00FF00" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

              xlsStr+='  <Style ss:ID="s113">\n';

               xlsStr+='   <Borders/>\n';

            xlsStr+='   <Interior ss:Color="#FE9016" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s115">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#FE9016" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s70ch">\n';

               xlsStr+='    <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#C0C0C0"/>\n';

            xlsStr+='      <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#C0C0C0"/>\n';

            xlsStr+='      <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#C0C0C0"/>\n';

            xlsStr+='      <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#C0C0C0"/>\n';

            xlsStr+='     </Borders>\n';

            xlsStr+='     <Interior ss:Color="#000000" ss:Pattern="Solid"/>\n';

            xlsStr+='    </Style>\n';

            xlsStr+='  <Style ss:ID="s71ch">\n';

            xlsStr+='   <Borders>\n';

            xlsStr+='     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#FFFFFF"/>\n';

            xlsStr+='     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#FFFFFF"/>\n';

            xlsStr+='     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#FFFFFF"/>\n';

            xlsStr+='     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#FFFFFF"/>\n';

            xlsStr+='   </Borders>\n';

            xlsStr+='   <Interior ss:Color="#FEB706" ss:Pattern="Solid"/>\n';

            xlsStr+='  </Style>\n';

            xlsStr+='  <Style ss:ID="s72ch">\n';

               xlsStr+='    <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

             xlsStr+='         ss:Color="#FFFFFF"/>\n';

            xlsStr+='      <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

             xlsStr+='         ss:Color="#FFFFFF"/>\n';

            xlsStr+='      <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

             xlsStr+='         ss:Color="#FFFFFF"/>\n';

            xlsStr+='      <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

             xlsStr+='         ss:Color="#FFFFFF"/>\n';

               xlsStr+='    </Borders>\n';

               xlsStr+='    <Interior ss:Color="#CDCDCD" ss:Pattern="Solid"/>\n';

              xlsStr+='  </Style>\n';

              xlsStr+='  <Style ss:ID="s73ch">\n';

               xlsStr+='    <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"\n';

             xlsStr+='         ss:Color="#FF0000"/>\n';

            xlsStr+='      <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"\n';

             xlsStr+='         ss:Color="#FF0000"/>\n';

            xlsStr+='      <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"\n';

             xlsStr+='         ss:Color="#FF0000"/>\n';

            xlsStr+='      <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"\n';

             xlsStr+='         ss:Color="#FF0000"/>\n';

               xlsStr+='    </Borders>\n';

               xlsStr+='    <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>\n';

              xlsStr+='  </Style>\n';

              xlsStr+='  <Style ss:ID="s75ch">\n';

               xlsStr+='    <Borders>\n';

            xlsStr+='       <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='       <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='       <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

               xlsStr+='    </Borders>\n';

               xlsStr+='    <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9"/>\n';

               xlsStr+='    <Interior ss:Color="#009966" ss:Pattern="Solid"/>\n';

              xlsStr+='  </Style>\n';

              xlsStr+='  <Style ss:ID="s76ch">\n';

               xlsStr+='    <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='      <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

               xlsStr+='   </Borders>\n';

               xlsStr+='   <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9"/>\n';

               xlsStr+='   <Interior ss:Color="#009966" ss:Pattern="Solid"/>\n';

              xlsStr+='  </Style>\n';

              xlsStr+='  <Style ss:ID="s78ch">\n';

               xlsStr+='    <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='      <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

            xlsStr+='      <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>\n';

               xlsStr+='    </Borders>\n';

               xlsStr+='    <Font ss:FontName="Arial" x:Family="Swiss" ss:Size="9"/>\n';

               xlsStr+='    <Interior ss:Color="#009966" ss:Pattern="Solid"/>\n';

              xlsStr+='  </Style>\n';

              //compatible responsible

            xlsStr+='  <Style ss:ID="strp">\n';

            xlsStr+='    <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#CDCDCD"/>\n';

            xlsStr+='      <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#CDCDCD"/>\n';

            xlsStr+='      <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#CDCDCD"/>\n';

            xlsStr+='      <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"\n';

            xlsStr+='       ss:Color="#CDCDCD"/>\n';

            xlsStr+='     </Borders>\n';

            xlsStr+='     <Interior ss:Color="#FFFFFF" ss:Pattern="VertStripe" ss:PatternColor="#7F7F7F"/>\n';

            xlsStr+='    </Style>\n';

            //compatible responsible with changed

            xlsStr+='    <Style ss:ID="strpRed">\n';

            xlsStr+='     <Borders>\n';

            xlsStr+='      <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"\n';

            xlsStr+='       ss:Color="#FF0000"/>\n';

            xlsStr+='      <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"\n';

            xlsStr+='       ss:Color="#FF0000"/>\n';

            xlsStr+='      <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"\n';

            xlsStr+='       ss:Color="#FF0000"/>\n';

            xlsStr+='      <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"\n';

            xlsStr+='       ss:Color="#FF0000"/>\n';

            xlsStr+='     </Borders>\n';

            xlsStr+='     <Interior ss:Color="#FFFFFF" ss:Pattern="VertStripe" ss:PatternColor="#7F7F7F"/>\n';

            xlsStr+='    </Style>\n';

            xlsStr+=' </Styles>\n';

           

            xlsStr+=' <Worksheet ss:Name="Sheet1">\n';

            xlsStr+='  <Table ss:ExpandedColumnCount="30000" ss:ExpandedRowCount="30000" x:FullColumns="1"\n';

            xlsStr+='   x:FullRows="1" ss:DefaultRowHeight="15" ss:DefaultColumnHeight="15" >\n';

            xlsStr+='   <Column ss:Width="117"/>\n';

            xlsStr+='   <Column ss:Width="16.5" ss:Span="1000"/>\n';

           

            //Legends code starts

            xlsStr+='      <Row ss:AutoFitHeight="0" ss:Height="1.75" ss:StyleID="s110"/>\n';

            xlsStr+='      <Row ss:AutoFitHeight="0" ss:Height="15" ss:StyleID="s110">\n';

            xlsStr+='        <Cell ss:StyleID="s109"><Data ss:Type="String" >Legends : </Data></Cell>\n';

            xlsStr+='        <Cell ss:StyleID="s67ch"/>\n';

            xlsStr+='        <Cell ss:StyleID="s113"><Data ss:Type="String" x:Ticked="1">- E5 Maintain</Data></Cell>\n';

            xlsStr+='        <Cell ss:StyleID="s113"/>\n';

            xlsStr+='        <Cell ss:StyleID="s113"/>\n';

            xlsStr+='        <Cell ss:StyleID="s113"/>\n';

            xlsStr+='        <Cell ss:StyleID="s113"/>\n';

            xlsStr+='      </Row>\n';

               xlsStr+='      <Row ss:AutoFitHeight="0" ss:Height="1.75" ss:StyleID="s110"/>\n';

           

            //Legends code ends

            xlsStr+='   <Row ss:Height="123.75">\n';

           

            //report date format changed to dd.mm.yyyy

            xlsReportDate = rd.getDate().toString()+"."+(rd.getMonth()+1).toString()+"."+rd.getFu llYear().toString();

           

            xlsStr+='    <Cell ss:StyleID="s81"><Data ss:Type="String">'+'&#10;Nokia Siemens&#10;Networks&#10;&#10;'+ Settings.reportName +'&#10;'+ Settings.reportAudience +'&#10;&#10;'+ xlsReportDate +'</Data></Cell>\n';

           

            relHorizontalHeading(_horizontalHierarchy);

                       

            xlsStr+='   </Row>\n';

           

            relVerticalHeading(_verticalHierarchy);

           

            xlsStr+='  </Table>\n';

            xlsStr+='  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">\n';

               xlsStr+='  <PageSetup>\n';

            xlsStr+='  <Header x:Margin="0.3"/>\n';

            xlsStr+='  <Footer x:Margin="0.3"/>\n';

            xlsStr+='  <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>\n';

            xlsStr+='  </PageSetup>\n';

            xlsStr+='  <Unsynced/>\n';

            xlsStr+='  <Selected/>\n';

            xlsStr+='  <FreezePanes/>\n';

            xlsStr+='  <FrozenNoSplit/>\n';

            xlsStr+='  <SplitHorizontal>4</SplitHorizontal>\n';

            xlsStr+='  <TopRowBottomPane>4</TopRowBottomPane>\n';

            xlsStr+='  <SplitVertical>1</SplitVertical>\n';

            xlsStr+='  <LeftColumnRightPane>1</LeftColumnRightPane>\n';

            xlsStr+='  <ActivePane>0</ActivePane>\n';

            xlsStr+='  <Panes>\n';

            xlsStr+='  <Pane>\n';

            xlsStr+='   <Number>3</Number>\n';

            xlsStr+='  </Pane>\n';

            xlsStr+='  <Pane>\n';

            xlsStr+='   <Number>1</Number>\n';

            xlsStr+='  </Pane>\n';

            xlsStr+='  <Pane>\n';

            xlsStr+='   <Number>2</Number>\n';

            xlsStr+='  </Pane>\n';

            xlsStr+='  <Pane>\n';

            xlsStr+='   <Number>0</Number>\n';

            xlsStr+='   <ActiveRow>0</ActiveRow>\n';

            xlsStr+='   <ActiveCol>68</ActiveCol>\n';

            xlsStr+='  </Pane>\n';

            xlsStr+='  </Panes>\n';

            xlsStr+='  <ProtectObjects>False</ProtectObjects>\n';

            xlsStr+='  <ProtectScenarios>False</ProtectScenarios>\n';

            xlsStr+='  </WorksheetOptions>\n';

            xlsStr+=' </Worksheet>\n';

            xlsStr+='</Workbook>\n';

    }

     private var checkMonth: String = "";

    

     public function relHorizontalHeading(iTreeItem:ITreeItem):void

        {

            var iterator: IIterator = iTreeItem.iterator();

            var item:ITreeItem;   

           

            while (iterator.hasNext())

            {

                    item = iterator.next() as ITreeItem;

                    var _title: String = item.getTitle();

                    if (item.getLevel() == 1 )

                    {

                        xlsStr+='    <Cell ss:StyleID="s69"><Data ss:Type="String">' + _title+ '</Data></Cell>\n';

                    } else if (item.getLevel() == 2 )

                    {

                        //xlsStr+='    <Cell ss:StyleID="s691"><Data ss:Type="String">' + _titleWeek + ' | ' +_title + '</Data></Cell>\n';

                        this.checkMonth = _title;

                    } else if (item.getLevel() == 3 )

                    {

                        if (this.checkMonth != "")

                        {

                            xlsStr+='    <Cell ss:StyleID="s691"><ss:Data ss:Type="String" x:Ticked="1" xmlns="http://www.w3.org/TR/REC-html40">' + _title + '  <B>' + this.checkMonth + '</B></Data></Cell>\n';

                            this.checkMonth = "";

                        }else

                        {

                            xlsStr+='    <Cell ss:StyleID="dottedLine"><Data ss:Type="String">' + _title+ '</Data></Cell>\n';

                        }

                    }

                    if (item.hasChildren())

                    {

                        relHorizontalHeading(item);

                    }

            }

        }

       

        public function relVerticalHeading(vTreeItem:ITreeItem):void

        {

            var iterator: IIterator = vTreeItem.iterator();

            var item:ITreeItem;   

            this.horiWeek = 1;                   

            while (iterator.hasNext())

            {

                    item = iterator.next() as ITreeItem;

                    if (item.getLevel() != 3 )

                    {

                        xlsStr+='   <Row ss:Height="15.75">\n';   

                    }

                           

                    if (item.getLevel() == 0 )

                    {

                        xlsStr+='    <Cell ss:StyleID="s83"><Data ss:Type="String">' + item.title + '</Data></Cell>\n';   

                    } else if (item.getLevel() == 1 )

                    {

                        xlsStr+='    <Cell ss:StyleID="s86"><Data ss:Type="String">' + item.title + '</Data></Cell>\n';

                    } else if (item.getLevel() == 2 )

                    {

                        xlsStr+='    <Cell ss:StyleID="s861"><Data ss:Type="String">' + item.title + '</Data></Cell>\n';

                    } else if (item.getLevel() == 3 )

                    {

                        //TODO:  for release type matrix no need for relase details...

                    }

                   

                    if (item.getLevel() != 3)

                    {

                       

                        this.relDataMatrix(item.getLevel(), item.getId(), _horizontalHierarchy, item);

                        xlsStr+='   </Row>\n';

                    }

                   

                    if (item.hasChildren())

                    {

                        relVerticalHeading(item);

                    }

            }

        }

       

         public function relDataMatrix(vItemLevel:Number, vItemID:String, hTreeItem:ITreeItem, vTreeItem:ITreeItem):void

        {

            var matrixIterator: IIterator = hTreeItem.iterator();

            var matrixItem:ITreeItem;   

            var relFound: Boolean = false;   

            var expLifecycle: Lifecycle;           

            while (matrixIterator.hasNext())

            {

                    matrixItem = matrixIterator.next() as ITreeItem;

                   

                            if (vItemLevel == 0  || matrixItem.getLevel() == 0)

                            {

                               

                                xlsStr+='    <Cell ss:StyleID="s89"><Data ss:Type="String"> </Data></Cell>\n';

                                   

                            }else if (vItemLevel == 1 || matrixItem.getLevel() == 1)

                            {

                               

                                xlsStr+='    <Cell ss:StyleID="s891"><Data ss:Type="String"> </Data></Cell>\n';

                                   

                            } else if (vItemLevel == 2 || matrixItem.getLevel() == 2)

                            {

                                                                                

                                if (matrixItem.getLevel() == 0 )

                                {

                                   

                                    xlsStr+='    <Cell ss:StyleID="s89"><Data ss:Type="String"> </Data></Cell>\n';

                                       

                                } else if (matrixItem.getLevel() == 1 )

                                {

                                   

                                    xlsStr+='    <Cell ss:StyleID="s891"><Data ss:Type="String"> </Data></Cell>\n';

                                       

                                }else if (matrixItem.getLevel() == 2 )

                                {

                                   

                                    //both month and week are displayed in same row - so this cell not needed

                                    //xlsStr+='    <Cell ss:StyleID="s892"><Data ss:Type="String"> </Data></Cell>\n';

                                   

                                }else if (matrixItem.getLevel() == 3 )

                                {

                               

                               

                                    var relItem:Array;

                                    relItem = vTreeItem.getItems();

                                    var expRelease:Release;

                                    var relFnd1Time:Boolean=false;

                                    for each ( expRelease in relItem)

                                    {

                                       

                                        for each ( expLifecycle in expRelease.expXLlifecycles )

                                        {

                                            var expWeekTo: Number = expLifecycle.weekTo;

                                            var exprelName: String = expLifecycle.releaseTitle;

                                            var toolTipStr:String;

                                            var toolTipDt:String;

                                           

                                            if (this.horiWeek == expWeekTo)

                                            {

                                                toolTipStr = vTreeItem.getTitle()+" ["+ expLifecycle.releaseTitle + "]";

                                                toolTipDt = expLifecycle.getDate().getDate().toString() + "." + (expLifecycle.getDate().month+1).toString() + "." + expLifecycle.getDate().fullYear.toString();

                                                //toolTipStr = vTreeItem.getTooltip();

                                                xlsStr+='    <Cell ss:StyleID="s8931"><Comment ss:Author="Compa"><ss:Data\n';

                                                xlsStr+='       xmlns="http://www.w3.org/TR/REC-html40"><Font html:Face="Tahoma"\n';

                                                xlsStr+='       html:Size="8" html:Color="#000000">';

                                                xlsStr+= toolTipStr + '&#10;' + toolTipDt;

                                               

                                                relFnd1Time=true;

                                                this.horiWeek++;

                                                relFound = true;

                                            }else if (expWeekTo == this.horiWeek-1 && relFnd1Time)

                                            {                                           

                                                toolTipStr = vTreeItem.getTitle()+" ["+ expLifecycle.releaseTitle + "]";

                                                toolTipDt = expLifecycle.getDate().getDate().toString() + "." + (expLifecycle.getDate().month+1).toString() + "." + expLifecycle.getDate().fullYear.toString();

                                                xlsStr+= '&#10; and &#10;' + toolTipStr + '&#10;' + toolTipDt;

                                            }

                                        }

                                    }

                                   

                               

                                if (!relFound)

                                {

                                    xlsStr+='    <Cell ss:StyleID="s893"><Data ss:Type="String"> </Data></Cell>\n';

                                       this.horiWeek++;

                                       relFnd1Time=false;

                                }else

                                {

                                    xlsStr+='</Font></ss:Data></Comment></Cell>\n';

                                    relFound = false;

                                    relFnd1Time=false;

                                }

                                }

                            }

                   

                    if (matrixItem.hasChildren())

                    {

                        relDataMatrix(vItemLevel, vItemID, matrixItem, vTreeItem);

                    }

            }

        }

 
Replies
  • Currently Being Moderated
    Feb 18, 2014 9:06 AM   in reply to Nashreen Banu

    There may be a library for xlsx handling, but I think more people use csv format.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 19, 2014 3:53 PM   in reply to Nashreen Banu

    Don't know.  None are built into Flex.  Looks like there is a third party library called as3xls

    http://code.google.com/p/as3xls/

     

    HTH,

    -Alex

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 20, 2014 4:31 PM   in reply to Nashreen Banu

    Neither Adobe nor Apache provides an ActionScript library for reading or writing .xlsx files, so you are unfortunately stuck with whatever 3rd party libraries you can find, and whatever bugs they happen to have.

     

    The simplest thing to do is reconsider the requirement (possibly unnecessary) that the file actually be .xlxs instead of .csv. Writing a .csv file should be relatively trivial in ActionScript. WHY do you, or your client, need the output to be .xlsx? Is it because you need elaborate formatting of the worksheet rather than simply the data?

     

    If you absolutely positively must have .xlsx then you are going to have to find another library that works, fix the one Alex found that doesn't work, or write your own. Fortunately, the .xlsx format seems to be documented by Microsoft, so in principle this should be possible. To start, I would focus on storing the data and only later, if it's really required, add the formatting. Your original code had tons of code for styles specifying borders, colors, etc. which you could start by eliminating.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 20, 2014 11:29 PM   in reply to Nashreen Banu

    is the data coming from some server? there are decent server-side solutions to handle spreadheet creation (like coldfusion or apache POI).

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 12, 2014 11:33 PM   in reply to Nashreen Banu

    Hi Banu,

     

    I am also facing the same issue. Did you find any resolution. If so, please let me know.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points