This project has moved. For the latest updates, please go here.

ExcelRow Outline Settings

Jun 14, 2011 at 1:33 PM

I have created a spreadsheet with outlines around groups of rows. The problem I have is that I can't find a property or setting to set the "Summary rows below detail" option

This will allow the expand (+) button of a collapsed group to appear level with the first row (the header) of that data instead of below

Has this functionality been implemented?

Thanks

Coordinator
Jun 16, 2011 at 6:44 AM

Use the Worksheet.OutLineSummaryBelow property, as in sample 6.

Jun 16, 2011 at 7:28 AM

Hi thanks jankallman - I couldn't find this when I was looking in the CHM help file - is there any supporting documentation taht describes what functionality has been included and where it can be found?

Coordinator
Jun 16, 2011 at 3:37 PM

Its is in the 2.9 chm file (ExcelWorksheet class) and used in sample 6.

Jul 20, 2011 at 10:11 PM
Edited Jul 20, 2011 at 10:12 PM

Does EPPlus support multiple levels outline? I saw the example in Sample 6, it only supports one level. Here is what I am trying to do

Line # |Category A | Sub-Category | Value|

1 | CS  | Basic| 1 |

2 | CS | Basic | 2 |

3 |      | Basic Total | 3|

4 | CS | Liq | 5 |

5 | CS | Liq | 6 |

6 |      | Liq Total | 11

7 | CS Total | | 14 |

I want to create level one that groups line 1 to 6, will collapse line 7.

Level two that that groups line 1 to 2, will collapse to line 3; groups line 4 to 5, will collapse to line 6

Thanks

Editor
Jul 21, 2011 at 11:37 AM

Something like that: 

 

            FileInfo tmpl = new FileInfo(@"c:\" + DateTime.Now.Ticks + ".xlsx");

            using (ExcelPackage pck = new ExcelPackage(tmpl))
            {
                var ws = pck.Workbook.Worksheets.Add("1");

      
                
                ws.Cells[2, 1].Value = "Drinks";
                ws.Row(2).OutlineLevel = 0;

                ws.Cells[3, 2].Value = "Juice";
                ws.Row(3).OutlineLevel = 1;

                ws.Cells[4, 3].Value = "Orange";
                ws.Row(4).OutlineLevel = 2;
                ws.Cells[5, 3].Value = "Melon";
                ws.Row(5).OutlineLevel = 2;
                ws.Cells[6, 3].Value = "Watermelon";
                ws.Row(6).OutlineLevel = 2;

                ws.Cells[7, 2].Value = "Softdrinks";
                ws.Row(7).OutlineLevel = 1;

                ws.Cells[8, 3].Value = "Coke";
                ws.Row(8).OutlineLevel = 2;
                ws.Cells[9, 3].Value = "Pepsi";
                ws.Row(9).OutlineLevel = 2;
                ws.Cells[9, 3].Value = "Sprite";
                ws.Row(9).OutlineLevel = 2;

                ws.Cells[10, 1].Value = "Food";
                ws.Row(10).OutlineLevel = 0;

                ws.Cells[11, 2].Value = "Junkfood";
                ws.Row(11).OutlineLevel = 1;

                ws.Cells[12, 3].Value = "Pizza";
                ws.Row(12).OutlineLevel = 2;
                ws.Cells[13, 3].Value = "Hamburguer";
                ws.Row(13).OutlineLevel = 2;
                ws.Cells[14, 3].Value = "Hotdog";
                ws.Row(14).OutlineLevel = 2;

                ws.Cells[15, 2].Value = "Salads";
                ws.Row(15).OutlineLevel = 1;

                ws.Cells[16, 3].Value = "Ceasar";
                ws.Row(16).OutlineLevel = 2;
                ws.Cells[17, 3].Value = "Tomato";
                ws.Row(17).OutlineLevel = 2;
                ws.Cells[18, 3].Value = "Potato";
                ws.Row(18).OutlineLevel = 2;




                pck.Save();
            }

 

Jul 21, 2011 at 4:04 PM

Yes, that works. Thanks