VB print job set-up question
  • Rob
    VB print job set-up question

    by Rob » Fri Oct 02, 2015 7:29 pm

    Hoping you can give me a quick answer. I am using R-ITOTEN.MAC and at the end of the script need to Create a print job form a cardfile.
    I have at the end of the script
    Declare MyScript Type Character
    MyScript := ""
    MyScript := cCustomer
    CreatePrintJob("gascol", Myscript, 1)
    cCustomer is returning the customer account code.
    What I am struggling with is Passing the result of cCustomer to the VB report so I can generate a the report. The report will be like and invoice listing address and details from the customer account then have Body1 being the items for the account in cardfile GASEMPTY.
    Have attached my starting point for the report.
  • COBS Tech Support
    Posts:683
    Joined:Fri Sep 09, 2005 8:23 am

    by COBS Tech Support » Fri Oct 02, 2015 7:31 pm

    You can't pass raw data, i.e., just the account code, because at the other end (VB) it will execute what you pass as a script. Image if you wrote a script:

    "ACME"

    (You just pass cAccount to the script parameter)

    What does this do? Well, nothing. You'd just get an error.

    So you need to pass some script statements; the statements need to set-up some variable(s) and assign them a value.

    So your script needs to be:

    Code: Select all

    cScript := "Declare MyAccount Type Character" + CHR(13) + CHR(10) 
    cScript := cScript + "MyAccount := '" + cCustomer + "'"


    At the other end, VB will see and then execute these lines:

    Declare MyAccount Type Character
    MyAccount := 'ACME'

    Then you can just query the value of MyAccount (variable) inside the VB report.

Who is online

Users browsing this forum: No registered users and 4 guests