[rt-users] Getting current record number in report using Weekly.html

Tom Lichti tom at redpepperracing.com
Tue Feb 18 12:21:32 EST 2003


SO, I have been hacking away at the 'Weekly.html' report that is in the 
rt-addons directory, and I am SO close to getting it to do what I want, but 
I am stuck on one thing. I need to get the current record number, since I 
want to do something different for the first record, versus the rest, so I 
would like to do something like the following:

if first_record
	do something
else
	do something different
endif

The area of code I am looking at is here:
%while (my $trans = $transes->Next) {
% if ($trans->Type =~ /Create|Comment|Correspond/) {
<%$transes->Count%>
<br>
<%$trans->Created%> <%$trans->Type%> by: <%$trans->CreatorObj->RealName%>
<blockquote>
<pre><%$trans->Content%></pre>
</blockquote>
% }
% }

% }

As you can see, I can get the total number of records with the 
$transes->Count, but I can't seem to get the current record number. I 
assume from looking at the SearchBuilder.pm that it is related to 
_ItemCounter, but I can't seem to grok how to achieve it. I have tried 
changing the above to $transes->ItemCounter, and variations.

I am NOT a developer, just a bad hacker. I know some perl, and I have 
pretty much understood most of what is going on there, but I just can't 
seem to make the next connection. If someone can give me a pointer or two 
as to what I am missing, I would greatly appreciate it.

Thanks
Tom




More information about the rt-users mailing list