How to set the Print button in a Form to call a Report.

billhwang2008billhwang2008 Member Posts: 32
Hi,

I'm a newcomer to Navision, now, I have a problem in Navision 4.0 as below:

As kenw that Purchase Order Form has a Print button, if click the button, the Form will call the Purchase Order Report to print it. In this way, I created a new Form and a new Report , add a Print button on the Form, but I don't know how to set the button to all the Report?

Any help appreciated!

Bill

Comments

  • idiotidiot Member Posts: 651
    Right click on the original button & look at the C/AL Code onPush() Control.
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • BeliasBelias Member Posts: 2,998
    or the runobject property...it's more clear for a plain run of the report.
    but you should study manuals before start developing...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • billhwang2008billhwang2008 Member Posts: 32
    Thank you all very much!

    To idiot:

    I right click the Print button, but the C/AL Code is not available, is it mean no license to support?


    To Belias:

    I am reading the manual: 8359B DEVELOPMENT I − C/SIDE INTRODUCTION TRAINING, is it more helpful? and, I wonder if you could recommend some better books.


    Best regards.

    Bill
  • BeliasBelias Member Posts: 2,998
    Ok for the manual: in the "Designing Reports" chapter, you'll find a lot of info about your problem.
    About c/al code: it's a license problem, try with the property, but in order to develop, you need a developer license :wink:
    oh, wait...are you in design mode? (object designer, click design while selecting your form)

    I can't suggest you other books, because i only read MOCs in order to get certifications...for the rest, i am learning day by day while working.
    but you can go to general chat section in mibuso, there's a topic about books there
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • billhwang2008billhwang2008 Member Posts: 32
    Belias wrote:
    Ok for the manual: in the "Designing Reports" chapter, you'll find a lot of info about your problem.
    About c/al code: it's a license problem, try with the property, but in order to develop, you need a developer license :wink:
    oh, wait...are you in design mode? (object designer, click design while selecting your form)

    I can't suggest you other books, because i only read MOCs in order to get certifications...for the rest, i am learning day by day while working.
    but you can go to general chat section in mibuso, there's a topic about books there


    Yes, I am in design mode :) , now, I solved it by your method, thank you very much.

    And, there is a new problem: the Request Form cannot get the Order's No. automatically, does it need to add the C/AL codes in Report? I read the codes of several Reports, just like "Purchase Order", "Return Order", etc., but I'm not so sure.
  • SavatageSavatage Member Posts: 7,142
    On push what's your code??
    is it something like this?

    RESET;
    PurchHeader.SETRANGE("Document Type","Document Type");
    PurchHeader.SETRANGE("No.","No.");
    REPORT.RUNMODAL("your report#",TRUE,FALSE,PurchHeader);
  • billhwang2008billhwang2008 Member Posts: 32
    Savatage wrote:
    On push what's your code??
    is it something like this?

    RESET;
    PurchHeader.SETRANGE("Document Type","Document Type");
    PurchHeader.SETRANGE("No.","No.");
    REPORT.RUNMODAL("your report#",TRUE,FALSE,PurchHeader);


    Thanks a lot for your reply.

    I did not find the OnPush in Report's C/AL code, is it Print button's C/AL code in the Form? But I haven't the license. :(
  • SavatageSavatage Member Posts: 7,142
    Did you just want to change the report that prints out? what was the need to create a whole new form?

    If it's about just the report - have you thought about changing the report selection.

    Search tables for "Report*" for me it's 77
  • billhwang2008billhwang2008 Member Posts: 32
    It's OK now :wink: , thank you all for your replies.
Sign In or Register to comment.