Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Commented Unassigned: Page breaks is not working EPPlus 4.0 Beta 2 [14991]

$
0
0
Hi Jan

I am facing page break issue in Epplus 4.0, previously i have used EPPlus 3.1, page break was working fine in Epplus 3.1 but later i have changed the class library Epplus 4.0 beta due to Title Repeat issue in V3.1, i could not able to use both column title repeat and row title repeat simultaneously, i can use only column title repeat or Row Title repeat in EPPLUS 3.1 stable Version , so please suggest me to rectify issue in page break or Title Repeat, it would be more helpful for me

Thank you for the awesome Class library
Comments: After looking through the code, the issue seems to be in ExcelWorksheet.UpdateRowBreaks(StreamWriter sw) ``` private void UpdateRowBreaks(StreamWriter sw) { StringBuilder breaks=new StringBuilder(); int count = 0; var cse = new CellsStoreEnumerator<object>(_values, 0, 0, ExcelPackage.MaxRows, 0); //foreach(ExcelRow row in _rows) while(cse.Next()) { var row=cse.Value as ExcelRow; if (row != null && row.PageBreak) { breaks.AppendFormat("<brk id=\"{0}\" max=\"1048575\" man=\"1\" />", cse.Row); count++; } } if (count>0) { sw.Write(string.Format("<rowBreaks count=\"{0}\" manualBreakCount=\"{0}\">{1}</rowBreaks>", count, breaks.ToString())); } } ``` When I changed it to the following with InternalRow instead of ExcelRow the problem was corrected. ``` private void UpdateRowBreaks(StreamWriter sw) { StringBuilder breaks=new StringBuilder(); int count = 0; var cse = new CellsStoreEnumerator<object>(_values, 0, 0, ExcelPackage.MaxRows, 0); //foreach(ExcelRow row in _rows) while(cse.Next()) { var row=cse.Value as RowInternal; if (row != null && row.PageBreak) { breaks.AppendFormat("<brk id=\"{0}\" max=\"1048575\" man=\"1\" />", cse.Row); count++; } } if (count>0) { sw.Write(string.Format("<rowBreaks count=\"{0}\" manualBreakCount=\"{0}\">{1}</rowBreaks>", count, breaks.ToString())); } } ```

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>