Help with Report.RUN()

Demonic240Demonic240 Member Posts: 65
I'm running a report using the Report.RUN; command and it works. However I don't want the request box to pop up. I tried running with the command REPORT.RUN(4129,FALSE,FALSE,report); but it didn't run the report completely. Is there something I'm missing in the code?

Comments

  • cnicolacnicola Member Posts: 181
    In the C/AL symbol menu you have functions for the report but also properties. And one of them is UseRequestForm. Set that to false before you use ReportVar.run. But REPORT.RUN(xyz,false) should have worked as well.

    BTW careful with RUN since that is not modal. What that means is that the system will launch the report but then move on with to the next line of code which might explain why your report did not finish when you used REPORT.RUN.
    Apathy is on the rise but nobody seems to care.
  • kinekine Member Posts: 12,562
    And if you set the UseSystemPrinter to False, you need to have printer somehow selected. Common way of calling report is
    REPORT.RUNMODAL(REPORT::"ID",False,True,MyRec);
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Demonic240Demonic240 Member Posts: 65
    Is it always safer to use RUNMODAL as opposed to RUN? And if not, what are the situations where you would use one over the other?
  • Demonic240Demonic240 Member Posts: 65
    This code does exactly what i need it to. I just want it to run silently.
    InteractionLogEntry.SETCURRENTKEY("Entry No.");
    InteractionLogEntry.SETFILTER("Document No.",Rec."Document No.");
    DeleteEntries.SETTABLEVIEW(InteractionLogEntry);
    DeleteEntries.RUNMODAL;
    

    When it runs is asks for filters for the report. How can I get it from popping up?
  • Igor_BeeoneIgor_Beeone Member Posts: 80
    edited 2007-10-15
    Hello,
    make USEREQUESTFORM(FALSE) before calling RUNMODAL.
    Br,
    Igor Beeone
  • Demonic240Demonic240 Member Posts: 65
    Ack, I'm sorry. That sounds like it'll work. But I don't know how to code that.
  • Igor_BeeoneIgor_Beeone Member Posts: 80
    Demonic240 wrote:
    Ack, I'm sorry. That sounds like it'll work. But I don't know how to code that.
    InteractionLogEntry.SETCURRENTKEY("Entry No."); 
    InteractionLogEntry.SETFILTER("Document No.",Rec."Document No."); 
    DeleteEntries.SETTABLEVIEW(InteractionLogEntry); 
    DeleteEntries.USEREQUESTFORM(FALSE);
    DeleteEntries.RUNMODAL;
    
  • Demonic240Demonic240 Member Posts: 65
    Tyvm. That did the job.
  • BrannmarkBrannmark Member Posts: 9
    Found this old thread as I need help with this,

    I want the re form not to be displayed, but I wnat the system print dialog to show so the user can select no of copies to print. Using this code:

    MyRecord.COPY(Rec);
    MyRecord.SETRANGE("Document Type", "Document Type");
    MyRecord.SETFILTER("No.","No.");
    MyReport.SETTABLEVIEW(InteractionLogEntry);
    MyReport.USEREQUESTFORM := FALSE;
    MyReport.RUNMODAL();

    This doesnt show the request form but also doesnt show the system dialog, and no printer is set for this report.

    Is this possible in Navision?
  • apertierraapertierra Member Posts: 61
    Or simply:
    InteractionLogEntry.SETCURRENTKEY("Entry No.");
    InteractionLogEntry.SETFILTER("Document No.",Rec."Document No.");
    REPORT.RUNMODAL(REPORT::"name of your report",FALSE,FALSE,InteractionLogEntry);
Sign In or Register to comment.