<tt><font size=2>Patrick Meidl &lt;patrick@pantheon.at&gt; wrote on 07/06/2012
04:00:09 PM:<br>
&gt; <br>
&gt; if you posted your code it would be easier to help debug it...<br>
&gt; <br>
&gt; &nbsp; &nbsp; patrick<br>
&gt; <br>
Here is my current code, which wants to go to the 86th row on a RS with
85 rows.</font></tt>
<br>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; my $sr = $c-&gt;model('ORANGES::Accountv')-&gt;search_rs({},
{});</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; my $wb = Spreadsheet::WriteExcel-&gt;new('/opt/catalyst/dbms/lib/dbms/output/output.xls');</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; my $ws = $wb-&gt;add_worksheet('Output');</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; my $col = 0; my
$row = 0;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; my @fields = qw/department_code
account_code account_name account_policy num_servers num_subsystems percent_complete
percent_compliant account_status/;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; foreach my $field
(@fields) {</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; $ws-&gt;write($row, $col, $field);</font></tt>
<br>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; $col++;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; }</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; $col=0;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; $row++;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; my $d = 1;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; my $e = 1;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; while (my @data
= $sr-&gt;next) {</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; foreach my $data (@data) {</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach my $field
(@fields) {</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; my $val = $data;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; foreach my $method (split(/\./, $field)) {</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $val = $val-&gt;$method;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; }</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ws-&gt;write($row,
$col, $val);</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $col++;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; $col=0;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; $e++;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; $row++;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; $d++;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; }</font></tt>
<br><tt><font size=2>I switched to a custom RS that removed the problem
of having to dig down and dereference, plus allowed me to create the account_status
column before rather than after. Long story.</font></tt>