Reoprt

Discussion in 'ASP General' started by amatuer, Jun 12, 2006.

  1. amatuer

    amatuer Guest

    Hi, im tryng to display some data in a report.
    The data im displaying is corect,but it contains calculating totals as
    well. The totals that r displayng r incorrect.Plaese hav a look at the
    code below to see if u cn spot anythng im doing wrong.

    <% If Method <> "" then %>
    <% If Method <> rstMain("Metode") then
    MTel = 0%>
    <TR>
    <td colspan="2"><font face="Tahoma" size="-2"
    color="Black"><B><I>Total for <%= Method %></I></B></font></td>
    <td align="right"><font face="Tahoma" size="-2" color="Black"><B><%=
    MTel %>fj</B></font></td>
    </tr>
    <% End If
    End If %>
    <tr>
    <td><font face="Tahoma" size="-2" color="Black"><%=
    rstMain("Metode") %></font></td>
    <td><font face="Tahoma" size="-2" color="Black"><%=
    rstMain("Onderwerp") %></font></td>
    <% If rstMain("Opmerking") <> "" Then %>
    <td><font face="Tahoma" size="-2" color="Black"><%=
    rstMain("Opmerking") %></font></td>
    <% Else %>
    <td><font face="Tahoma" size="-2" color="Black">&nbsp;</font></td>
    <% End If %>
    </tr>
    <% MTel = MTel + 1 %>
    <%Method = rstmain("Metode")
    Total1 = Total1 + 1 %>
    <%rstMain.Movenext
    Wend %>
    <TR>
    <td colspan="2"><font face="Tahoma" size="-2"
    color="Black"><B><I>Total for <%= Method %></I></B></font></td>
    <td align="right"><font face="Tahoma" size="-2" color="Black"><B><%=
    MTel %></B></font></td>
    </tr>
    <TR>
    <td colspan="2"><font face="Tahoma" size="-2"
    color="Black"><B><I>Total for Contacts for the
    Month</I></B></font></td>
    <td align="right"><font face="Tahoma" size="-2" color="Black"><B><%=
    Total1 %></B></font></td>
    </tr>
    <% End If %>

    The total which is diaplyng wrong is the 1st MTel.Of which is contained
    in an if statement which should nt excecute because the condition does
    nt fulfill,bt it is excecuting.

    Please help!
     
    amatuer, Jun 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page