Options

calling a Classic report from a page subform

steven77steven77 Member Posts: 16
edited 2011-11-27 in NAV Three Tier
Good afternoon
I've this problem:
I deplove a report that print labels with barcodes, so users can run this report manualy (must set some values ) or from the page 12153 Subcontracting Order Subform, so in the report i did a function Setvalues(RecPurchaseLine) that assign automaticaly the values form Purchase Line table,
I create a page action for this, and then call a function that execute this code:
MyReport.SetValues(Rec);
MyReport.RUNMODAL;

look RTC client error in attached file.

seems that with RTC i can't call a function in a report before i have not run the report, so how i can solve my problem?
I've tried also do put another dataitem in report "Purchase Line"
And from the function in the page write code below:

RecPurchLine.SETRANGE("Document Type", "Document Type");
RecPurchLine.SETRANGE("Document No.", "Document No.");
RecPurchLine.SETRANGE("Line No.", "Line No.");
MyReport.SETTABLEVIEW(RecPurchLine);
MyReport.RUNMODAL;

It not work no filters are applied to MyReport

Help me please!!! ](*,) ](*,) ](*,) ](*,) ](*,)

Comments

  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    steven77 wrote:
    Good afternoon
    I've this problem:
    I deplove a report that print labels with barcodes, so users can run this report manualy (must set some values ) or from the page 12153 Subcontracting Order Subform, so in the report i did a function Setvalues(RecPurchaseLine) that assign automaticaly the values form Purchase Line table,
    I create a page action for this, and then call a function that execute this code:
    MyReport.SetValues(Rec);
    MyReport.RUNMODAL;

    look RTC client error in attached file.

    seems that with RTC i can't call a function in a report before i have not run the report, so how i can solve my problem?
    I've tried also do put another dataitem in report "Purchase Line"
    And from the function in the page write code below:

    RecPurchLine.SETRANGE("Document Type", "Document Type");
    RecPurchLine.SETRANGE("Document No.", "Document No.");
    RecPurchLine.SETRANGE("Line No.", "Line No.");
    MyReport.SETTABLEVIEW(RecPurchLine);
    MyReport.RUNMODAL;

    It not work no filters are applied to MyReport

    Help me please!!! ](*,) ](*,) ](*,) ](*,) ](*,)

    The only solution is to convert the report.
    ~Rik~
    It works as expected... More or Less...
  • Options
    lvanvugtlvanvugt Member Posts: 774
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    steven77steven77 Member Posts: 16
    lvanvugt wrote:

    With RUN is the same....
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    steven77 wrote:
    lvanvugt wrote:

    With RUN is the same....

    the problem is that your report is a classic report.
    you can call it in RTC, but if you want to use a function defined in the report before launching it, you've to create a RTC Layout for it.
    ~Rik~
    It works as expected... More or Less...
  • Options
    kinekine Member Posts: 12,562
    It should work if you use:
    RecPurchLine.SETRANGE("Document Type", "Document Type");
    RecPurchLine.SETRANGE("Document No.", "Document No.");
    RecPurchLine.SETRANGE("Line No.", "Line No.");
    REPORT.RUN(REPORT::"MyReport",true,false,RecPurchLine);
    

    If you are calling the report through variable, it must have Layout (to be compiled in .net).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.