Skip to Content
मेन्यू
This question has been flagged
1 Reply
5130 Views

Hi,

I have this bit of code:

%for analysis in inv.x_tcc_analysis_ids :   
            <td width="20%" style="text-align:left;border:1px solid #555;border-left:none;padding-top: 8px;">
              <table width="100%" cellspacing="0" cellpadding="10px">
                  <tbody>
                    <tr><td style="text-align:center;border:none;border-bottom:1px solid #555;;">Year ${ analysis.x_year or '' |entity }</td></tr>
                    <tr><td style="text-align:right;border:none;border-bottom:1px dashed #555;">N ${ formatLang(analysis.x_total_income) or ''|entity }</td></tr>
                    <tr><td style="text-align:right;border:none;border-bottom:1px dashed #555;">N ${ formatLang(analysis.x_tax_paid) or '' |entity }</td></tr>
                    <tr><td style="text-align:right;border:none;border-bottom:1px dashed #555;">${ analysis.x_gitr_number or '' |entity }</td></tr>
                    <tr><td style="text-align:right;border:none;border-bottom:1px dashed #555;">${ analysis.x_gitr_date or '' |entity }</td></tr>
                  </tbody>
              </table>
            </td>      
        %endfor

I'd like to be able to limit the number of iterations to 3. I've tried using the range function but no joy so far.

Any help will be hugely appreciated. Thanks

Avatar
Discard
Best Answer

use this:

<% i = 0 %>
%for analysis in inv.x_tcc_analysis_ids : 
    <% i+=1 %>
    %if i == 4:
        break
    %endif
    ...
    ...
Avatar
Discard
Author

Worked nicely. Thank you.

sounds good..:)

Related Posts Replies Views Activity
4
सित॰ 16
9087
1
जन॰ 16
4235
0
मार्च 15
4364
3
मार्च 15
11198
2
अप्रैल 24
2198