Skip to content

Commit

Permalink
Remover apenas começo e fim de colunas em branco (trim)
Browse files Browse the repository at this point in the history
  • Loading branch information
dude333 committed Oct 4, 2023
1 parent 95b6717 commit 018a3a9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cmd/relatorio.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,23 @@ func excelReport(x *excel.Excel, itr []rapina.InformeTrimestral, decrescente boo
// Freeze panes
_ = x.FreezePane("C2")

// Delete empty columns
// Trim empty columns
hasData := rapina.TrimestresComDados(itr)
if decrescente {
reverseb(hasData)
}
for i := len(hasData) - 1; i >= 0; i-- {
if !hasData[i] {
_ = x.RemoveCol(initCol + i)
if hasData[i] {
break
}
_ = x.RemoveCol(initCol + i)
}
for i := 0; i < len(hasData); i++ {
if hasData[i] {
break
}
_ = x.RemoveCol(initCol)

}
} // excelReport =====

Expand Down

0 comments on commit 018a3a9

Please sign in to comment.