Ok, the second "for" is about the Rows, not the Columns (duh).<div>And the "Rows[i]" does not know about visibility.</div><div>Maybe a hand-made FOR to create the line is needed?<br><br><div class="gmail_quote">
2012/10/15 Alexsander Rosa <span dir="ltr"><<a href="mailto:alexsander.rosa@gmail.com" target="_blank">alexsander.rosa@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've managed to modify Grids.pas (SaveToCSVStream, line 10452) for the headers:<div><br><div><div><font face="courier new, monospace"><b> for i := 0 to ColCount-1 do begin</b></font></div><div><font face="courier new, monospace"><b> c := ColumnFromGridColumn(i);</b></font></div>
<div><font face="courier new, monospace"><b> if c=nil then</b></font></div><div><font face="courier new, monospace"><b> HeaderL.Add(Cells[i, 0])</b></font></div><div><font face="courier new, monospace"><b> else</b></font></div>
<div><font face="courier new, monospace"><b> <span style="background-color:rgb(255,255,153)">if c.Visible then</span></b></font></div><div><font face="courier new, monospace"><b> HeaderL.Add(c.Title.Caption);</b></font></div>
<div><font face="courier new, monospace"><b> end;</b></font></div><div><br></div><div>But the other "IF" for the data did not work:</div><div><br></div><div><div><font face="courier new, monospace"><b> for i:=StartRow to RowCount-1 do begin</b></font></div>
<div><font face="courier new, monospace"><b> <span style="background-color:rgb(255,255,153)">c := ColumnFromGridColumn(i);</span></b></font></div><div><font face="courier new, monospace"><b> <span style="background-color:rgb(255,255,153)">if c <> nil then</span></b></font></div>
<div><font face="courier new, monospace"><b> <span style="background-color:rgb(255,255,153)">if not c.Visible then Continue;</span></b></font></div><div><font face="courier new, monospace"><b> Rows[i].StrictDelimiter := False; //force quoting of strings that contain whitespace or Delimiter</b></font></div>
<div><font face="courier new, monospace"><b> Rows[i].Delimiter:=ADelimiter;</b></font></div><div><font face="courier new, monospace"><b> Lines.Add(Rows[i].DelimitedText);</b></font></div><div><font face="courier new, monospace"><b> end;</b></font></div>
<div><br></div><div>Any ideas?</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br>Atenciosamente,<br>Alexsander da Rosa<br><br><br>
</font></span></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Atenciosamente,<br>Alexsander da Rosa<br><br><br>
</div>