an error during calling report from page

snyktpsnyktp Member Posts: 75
edited 2010-04-20 in NAV Three Tier
Hi,

I have a problem during running a report from another object(page). You can see the my codes below. Those codes are on an action (menu item) on a page (form). I get an error when i call the report,the error related to yellow line.You can see the error at the attachement.


SalesHeader := Rec;
SalesHeader.SETRECFILTER;

CLEAR(PDDocument2);
PDDocument2.SETTABLEVIEW(SalesHeader);
PDDocument2.SetBoxQty(Rec);
PDDocument2.RUNMODAL;

Thank you

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    snyktp wrote:
    Hi,

    I have a problem during running a report from another object(page). You can see the my codes below. Those codes are on an action (menu item) on a page (form). I get an error when i call the report,the error related to yellow line.You can see the error at the attachement.


    SalesHeader := Rec;
    SalesHeader.SETRECFILTER;

    CLEAR(PDDocument2);
    PDDocument2.SETTABLEVIEW(SalesHeader);
    PDDocument2.SetBoxQty(Rec);
    PDDocument2.RUNMODAL;

    Thank you

    the report PDDocument2 is not transformed into RTC
  • snyktpsnyktp Member Posts: 75
    Thank you for the answer but i dont think so. because when i call the repurt like this

    dynamicsnav:////runreport?report=61033, the report runs.

    the problem is related to yellow line because before running report, i call a function from the report.

    thank you
  • kinekine Member Posts: 12,562
    The report runs, but it runs as RDLC or as window from Classic client?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • snyktpsnyktp Member Posts: 75
    Hi,

    It runs as windows form classic client because ProcessingOnly of report is NO. If it is YES,it will run as RDLC. Can you see the error message? It says that you call a function from report,before running report.

    Thank you
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    snyktp wrote:
    Hi,

    It runs as windows form classic client because ProcessingOnly of report is NO. If it is YES,it will run as RDLC. Can you see the error message? It says that you call a function from report,before running report.

    Thank you

    is this a customization thet if ProcessingOnly of report is NO then run Classic and if yes run RDLC? :-k

    if not,

    its not like that if ProcessingOnly of report is NO then run classic .

    the report is not transformed.

    export the report in text format and check whether rdl data is there or not


    its not related to function called before the report
  • snyktpsnyktp Member Posts: 75
    Hi,

    But when I delete yellow line ,it runs. Is not it strange? Because you said that it is not related to calling a function before running report.

    SalesHeader := Rec;
    SalesHeader.SETRECFILTER;

    CLEAR(PDDocument2);
    PDDocument2.SETTABLEVIEW(SalesHeader);
    PDDocument2.SetBoxQty(Rec);
    PDDocument2.RUNMODAL;

    It has this line.

    }
    RDLDATA
    {
    }


    Thank you
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    the first thing is report not transformed as rdl data is blank

    and can you post the code in SetBoxQty funtion
  • snyktpsnyktp Member Posts: 75
    Hi Mohana,

    What should I do? I dont understand what you want to say.

    Than kyou
  • kinekine Member Posts: 12,562
    Problem is this:

    the mechanism, which allows you to run report as classic client report, is working only in situations, when the report is called through REPORT.RUN/RUNMODAL or directly through button properties. You cannot run classic report through report variable, because it is not allowed/possible by design of the system. This is what the error tells you. You need to run the report as RTC report (RDLC) to be able to call it through report variable.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    snyktp wrote:
    Hi Mohana,

    What should I do? I dont understand what you want to say.

    Than kyou

    1)i want to see the code written in SetBoxQty funtion

    can you paste the code here.
    but i strongly feel, its not the problem.


    2)open the report in design mode and click tools-->Create layout suggestion
    and save the rdlc

    test after doing 2
  • snyktpsnyktp Member Posts: 75
    Hi,

    The function is below

    SetBoxQty(SalesHeader : Record "Sales Header")
    WITH SalesLine DO BEGIN
    SETCURRENTKEY("Document Type","Document No.","Item Type");
    SETRANGE("Document Type",SalesHeader."Document Type");
    SETRANGE("Document No.",SalesHeader."No.");
    SETRANGE("Item Type","Item Type"::Container);
    CALCSUMS(Quantity);
    TotalBoxQty := Quantity;
    END;

    I tried 2. step , i got an error. it say "An error occured when opening Report designer. A supported version of Visual Studio could not be found"

    Thank you for your help
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    snyktp wrote:
    Hi,

    I tried 2. step , i got an error. it say "An error occured when opening Report designer. A supported version of Visual Studio could not be found"

    Thank you for your help

    you need to instal the visual studio(>=2005) in your system.
  • snyktpsnyktp Member Posts: 75
    but I have already installed Visual Studio Express 2008, so I don’t understand the error.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    I think you have not installed complete visual studio/sql server
  • snyktpsnyktp Member Posts: 75
    you are right. Thank you
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    snyktp wrote:
    you are right. Thank you

    welcome :thumbsup:
  • petevanspetevans Member Posts: 78
    (Reposted in new post)
    NAVN00b
Sign In or Register to comment.