Method Community

 

Need Report Designer VB FOR...NEXT loop

Last post 04-08-2015 2:42 PM by robert.cowart. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-01-2015 11:11 AM

    Need Report Designer VB FOR...NEXT loop

    I need a FOR...NEXT loop in an OnBeforePrint event.  Where is the language documentation for all supported VB logical constructs within events in the Report Designer?

    Thanks!

  • 04-01-2015 11:46 AM In reply to

    Re: Need Report Designer VB FOR...NEXT loop

    Answer

    Hi Rob,

    We don’t have any documentation for what is supported through VB and C# in Report Designer scripts. You can find a VB reference guide on Microsoft’s website. There may be a few limitations, but you will need to discover these through trial and error. Have you tried creating the script yet? What was the result?

    I know we support For Each statements, and am fairly sure that you can use a For…Next statement. If you are having difficulty with a script, maybe you can tell me what you’ve got so far and detail what it is that you are trying to accomplish. I’m happy to look into it.

    -Audisho

    Audisho Sada
    Product Manager
    Method:CRM
    a.sada@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 04-08-2015 2:42 PM In reply to

    Re: Need Report Designer VB FOR...NEXT loop

    Here is the FOR...LOOP construct I am using successfully:

    .....

    FOR Week as integer = 1 to WeekCount '' what if its one week and WeekCount = 0?? Does the loop fire once at least? 

      newrate = cSng(WeekCounter.text) + 1 ' or to create a loop that calcs it once correctly, including W,1,B SOL freq
      WeekCounter.text = newrate.tostring
      ForDate = Microsoft.VisualBasic.DateAdd("d", ((Week-1) * 7) , ForStartDate )
      IF FirstOfYear <= ForDate and ForDate <= StartDateParm then
        if UpperOther1 <> "W" then ' will this with the W and w?
          if ( UpperOther1 = "B" AND ( Microsoft.VisualBasic.DATEDIFF("d", ForStartDate, ForDate) MOD 14 = 0 ) ) OR _
             ( UpperOther1 = "1" AND ( Microsoft.VisualBasic.DATEDIFF("d", ForStartDate, ForDate) MOD 28 = 0 ) ) then
            wkly = SngRate
          else
            wkly = 0.0
          end if
        end if
        newrate = cSng(ClassYTDRevenue.text) + wkly ' or to create a loop that calcs it once correctly, including W,1,B SOL freq
        ClassYTDRevenue.text = newrate.tostring
        newrate = cSng(TotalYTDRevenue.text) + wkly ' or to create a loop that calcs it once correctly, including W,1,B SOL freq
        TotalYTDRevenue.text = newrate.tostring
      END IF
    NEXT

    .....

Page 1 of 1 (3 items)