New-Bee needs help -step 1 in programming

jcnjcn Member Posts: 14
edited 2003-12-22 in Navision Attain
Hello every one -and merry Christmas to you all :D

The simple problem:
I need to make a command button on my sales header form that calls my new report with the order no. from the sales header.
So I need to parse the order number from the sales header to the report!

I have downloaded the example made on these pages (parsing parameters between objects) and I understand the core of it, but I can not seem to get it working.

I know that this is very simple to most of you, but I hope that you will give me a few minutes of your time and make a small "step by step" guide for me :D

Hopefully this will give me the basic knowledge to go through "bigger" things myself afterwards.

I run Attain 3.60 in danish.

-thanks in advance!
Best regards
Jens Christian Nørtoft
Denmark

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Have a look at the on-line help at REPORT.RUNMODAL
    (or look at my Navision reference guide you can download here: http://www.mibuso.com/dlinfo.asp?FileID=288 ).
    REPORT.RUNMODAL(Number [, ReqWindow] [, SystemPrinter] [, Record])

    Number
    Data type: integer

    The ID of the report you want to execute.

    ReqWindow
    Data type: boolean

    Tells the system whether it should display the request window for the report.

    SystemPrinter
    Data type: boolean

    Tells the system whether it should use the default Windows printer or use the Printer Selection table to find the right printer for this report. For example, if the report prints on continuous forms, you can set up an entry in the Printer Selection table to tell the system to always print this report on a specific printer.

    Record
    Data type: record

    Tells the system which record to use in the report. The system will use any filters attached to the record you specify.

    Example: REPORT.RUNMODAL(50000, TRUE, FALSE, Rec);

    Put this in the OnPush-trigger of your Command button.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • jyotsnasjyotsnas Member Posts: 62
    Hi jcn

    A merry chrismas to you too.

    I will present a generic scenario here wherein we have

    a form : say form1
    value to be passed to report : value
    a report to be invoked from within form1 : report1
    a global variable in report1 : FilterValue

    1:
    You need to have a function in report1 : SetValue that would assign value to FilterValue

    SetValue( value as type)
    {
    FilterValue = value
    }


    2:
    In report1, on preDataItem

    DataItem.setfilter( ValueField, FilterValue)

    valueField is the field in dataItem that maps to the FilterValue.


    3:
    OnClick of GenerateReport on Form1, you need to do this
    Report1.SetValue( value )

    value is OrderNo in ur case.

    4.
    After setting the value, run the report.
    Report1.run

    And you should have ur work done. 8)

    regards

    Jyotsna
    ______Doubt is the father of Invension_______
  • jcnjcn Member Posts: 14
    Hello Guys

    Thanks for the fast and thorough answers -I look foreward to the holidays so I can test, try and learn :-)
    Best regards
    Jens Christian Nørtoft
    Denmark
  • Marco_FerrariMarco_Ferrari Member Posts: 53
    If you have to print a Sales Order and you want to use a different report form the standard one, you have just to change it in the Sales Report list. Form Sales and Receivables, click Setup, Report Selections Sales. In that window you can associate a Document with its report.
    I don't know if this is the case, otherwise use the samples you read in this forum.

    Bye,
    Marco
    Marco Ferrari
    Microsoft Certified Trainer
    Cronus.it
Sign In or Register to comment.