OutlineLevel and Collapsed

Mar 2, 2010 at 11:08 AM
Edited Mar 2, 2010 at 11:36 AM

Hello

I test then version 56142 and i have a problem with the code below

        Dim NewFichier As String = "Excel.xlsx"
        Dim newFile As FileInfo = New FileInfo(NewFichier)
        Using pck As New ExcelPackage(newFile)

            Dim Ws_CatProjet As ExcelWorksheet = pck.Workbook.Worksheets.Add("Sheet1")
            Ws_CatProjet.OutLineSummaryBelow = False

            Ws_CatProjet.Cells(8, 1).Value = "Line 8"
            Ws_CatProjet.Row(8).OutlineLevel = 0
            Ws_CatProjet.Row(8).Collapsed = False

            Ws_CatProjet.Cells(9, 1).Value = "Line 9"
            Ws_CatProjet.Row(9).OutlineLevel = 1
            Ws_CatProjet.Row(9).Collapsed = False

            Ws_CatProjet.Cells(10, 1).Value = "Line 10"
            Ws_CatProjet.Row(10).OutlineLevel = 2
            Ws_CatProjet.Row(10).Collapsed = True

            Ws_CatProjet.Cells(11, 1).Value = "Line 11"
            Ws_CatProjet.Row(11).OutlineLevel = 3
            Ws_CatProjet.Row(11).Collapsed = True


            pck.Save()
        End Using
       

When open with Excel, it's not possible to expand the line 9 ( and the lines 10, 11)

 

 

If replace          Ws_CatProjet.Row(xx).Collapsed = True 

by      Ws_CatProjet.Row(xx).Collapsed = false

It's OK...

 

Thanks

Fabrice.

 

 

Mar 2, 2010 at 11:09 AM

        Dim NewFichier As String = "Excel.xlsx"
        Dim newFile As FileInfo = New FileInfo(NewFichier)
        Using pck As New ExcelPackage(newFile)

            Dim Ws_CatProjet As ExcelWorksheet = pck.Workbook.Worksheets.Add("Sheet1")
            Ws_CatProjet.OutLineSummaryBelow = False

            Ws_CatProjet.Cells(8, 1).Value = "Line 8"
            Ws_CatProjet.Row(8).OutlineLevel = 0
            Ws_CatProjet.Row(8).Collapsed = False

            Ws_CatProjet.Cells(9, 1).Value = "Line 9"
            Ws_CatProjet.Row(9).OutlineLevel = 1
            Ws_CatProjet.Row(9).Collapsed = False

            Ws_CatProjet.Cells(10, 1).Value = "Line 10"
            Ws_CatProjet.Row(10).OutlineLevel = 2
            Ws_CatProjet.Row(10).Collapsed = True

            Ws_CatProjet.Cells(11, 1).Value = "Line 11"
            Ws_CatProjet.Row(11).OutlineLevel = 3
            Ws_CatProjet.Row(11).Collapsed = True


            pck.Save()
        End Using
       

Mar 2, 2010 at 11:53 AM

I use "Open XML SDK 2.0 CTP" for compare two files

I show

Sheet OK : -->Row row3 = new Row(){ RowIndex = (UInt32Value)10U, Hidden = true, OutlineLevel = 2, Collapsed = true };

Sheet KO : --> Row row3 = new Row(){ RowIndex = (UInt32Value)10U, Height = 0D, Hidden = true, CustomHeight = true, OutlineLevel = 2, Collapsed = true };

 

Thanks...

 

 

Coordinator
Mar 2, 2010 at 12:27 PM

Hi

It's a bug, as you proberbly guessed. The Height is set to 0 if collapsed, and that didn't work to well.

Remove all code from the ExcelRow.Height get property except <font size="2">

 

</font>

return _height;

I haven't testet it fully, so please tell me if you have any futher problems. I'll have a more close look at it before my next checkin

Jan

Mar 2, 2010 at 2:51 PM

Hello,

It's OK

Thanks for your help.

Fabrice.