Problem calling report using RUNMODAL

fmhiguefmhigue Member Posts: 290
I am calling a report using RUNMODAL. The reports runs without a problem actually I am sending the parameters for the report but the only thing is it gets printed automatically.

Is there any way to deactive print option?

Thank you in advance

Comments

  • kinekine Member Posts: 12,562
    You can prevent printing from Preview by using command CurrReport.Preview. If this function is called in report, you cannot print the report from preview.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • fmhiguefmhigue Member Posts: 290
    I got the code as follow

    CLEAR(BackorderByItemReport);
    BackorderByItemReport.SetProperties('7400',TRUE,TRUE,TRUE);
    BackorderByItemReport.USEREQUESTFORM(FALSE);
    BackorderByItemReport.RUNMODAL();

    Parameters on SetProperties'
    7400 Inventory Posting Group
    TRUE Qty on Purchase Order >0
    TRUE Create excel file
    TRUE Call from another report

    So I need to change the actual report I am calling? If I use CurrReport.PREVIEW it will only allow preview but no print. If I hide Request Form it will do the same?
  • kinekine Member Posts: 12,562
    It will disable printing from preview, but not printing directly. You know, reports are there for printing. If you want report which you cannot print, it is something against main functionality of the report... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_CoxDavid_Cox Member Posts: 509
    edited 2007-08-06
    kine wrote:
    It will disable printing from preview, but not printing directly. You know, reports are there for printing. If you want report which you cannot print, it is something against main functionality of the report... 8)

    Not quite true, there are processing only reports, that run the code and have no sections to print.
    Like report 84 Update Analysis Views, this runs the code only, to Update Analysis Views.

    fmhigue
    Not quite sure what you mean by your post, do you want a print but not automatic, but the report prints because you have this line:
    BackorderByItemReport.USEREQUESTFORM(FALSE);
    Set this to true for the options form to show, and for user intervention, then your report will not go straight to the printer.
    BackorderByItemReport.USEREQUESTFORM(TRUE);

    BackorderByItemReport.USEREQUESTFORM(FALSE);
    This means the option to print or Preview is not offered, as the requestform is not shown.

    David :)
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • kinekine Member Posts: 12,562
    Of course... :wink:

    I mean just reports and not batches... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • idiotidiot Member Posts: 651
    There is a fundamental flaw in Navision with respect to codeunits & reports.
    If reports are/can be used for processing then why have codeunits at all?
    Is it because codeunits are not able to produce the user request form so they made reports that can process?
    seesh...
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kine wrote:
    Of course... :wink:

    I mean just reports and not batches... :-)

    Hey Kamil, I think that what he wants is for the report to open with the Request window showing, so that the user can then decide to print or not. I do not think this is a Batch process.

    David's solution is I think the correct one.
    David Singleton
  • David_CoxDavid_Cox Member Posts: 509
    idiot wrote:
    There is a fundamental flaw in Navision with respect to codeunits & reports.
    If reports are/can be used for processing then why have codeunits at all?
    Is it because codeunits are not able to produce the user request form so they made reports that can process?
    seesh...

    Flaw or Feature, true use a report if you want to give the user request form options, or you do not have codeunits on your licence. :)

    David
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • kinekine Member Posts: 12,562
    It seems I missed the meaning of the question... #-o

    But discussion without the person who asked is waste of time... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.