Method Community

 

Report Designer - How to access a CrossBandLine from script (error BC30451)

Last post 06-12-2015 3:16 PM by Method_Audisho. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-12-2015 11:27 AM

    Report Designer - How to access a CrossBandLine from script (error BC30451)

    Hi,

    In report designer, I try to access a crossbandline in script. However, I always get error like:

    Detail.OnBeforePrint, Line 27: error BC30451: Name "cvbl5" is not declared.

    "cvbl5" is name of my crossbandline. I can access label in the script without any problem, so the question is, how can I access crossbandline in script? Thanks.

    Alex

    Chief Architect
    Yi Systems, Inc.
    alexhuang@yisystems.com
    www.yisystems.com blogs.yisystems.com
    Software.Web.Cloud.IT
  • 06-12-2015 12:40 PM In reply to

    Re: Report Designer - How to access a CrossBandLine from script (error BC30451)

    Hi Alex,

    Have you had a look at the XRCrossBandLine documentation? Would you consider posting your script? It’s difficult for me to determine the cause of the issue without seeing what you’re doing.

    -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
  • 06-12-2015 2:05 PM In reply to

    Re: Report Designer - How to access a CrossBandLine from script (error BC30451)

    Hi,

    In my report, I put a OnBeforePrint script in one "Detail" band, under this "Detail" band, there are some crossbandline, one crossbandline is named as "cbvl5"

    Here are code segment:

    Private Sub OnBeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)


    Dim bPrintContainerNoAndDepot as Boolean
    bPrintContainerNoAndDepot = False

    [skip some codes]

    if (bPrintContainerNoAndDepot = True) then
    lblContainerNo.Visible = True
    lblDepot.Visible = True
    fldContainerNo.Visible = True
    fldDepot.Visible = True

    ''Item size
    else
    lblContainerNo.Visible = false
    lblDepot.Visible = false
    fldContainerNo.Visible = False
    fldDepot.Visible = False
    cbvl5.Visible = False

    [skip some codes]

    while previewing this template, I got this error message:

    Detail.OnBeforePrint, line 27: error BC30451: Name: "cbvl5" is not declared.

    it seems that the program can not find "cbvl5". (but for other UI items like label, it is no problem to access them.)

    Chief Architect
    Yi Systems, Inc.
    alexhuang@yisystems.com
    www.yisystems.com blogs.yisystems.com
    Software.Web.Cloud.IT
  • 06-12-2015 3:16 PM In reply to

    Re: Report Designer - How to access a CrossBandLine from script (error BC30451)

    Hi Alex,

    It looks like cross-band lines may not be available to scripts. Most objects exist within a band, but by definition, cross-band lines do not. I believe this poses a problem for Report Designer being able to reference them within a script. You’ll notice that you are also unable to apply a script directly on a cross-band line object.

    You may be able to accomplish this using conditional formatting instead by applying a formatting rule to your cross-band line. Your other option would be to use multiple standard line objects instead.

    I hope this helps.

    -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
Page 1 of 1 (4 items)