Converting Reports- OnPreSection() trigger

poppinspoppins Member Posts: 647
edited 2013-01-02 in NAV Three Tier
Hi everyone,

I am converting some reports from Nav 2009 R2 to Nav 2013...
For some reports, there is several lines of code in the OnPreSection() trigger, which is no longer supported by Nav 2013...

What shall I do to include this code in the converted report???

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Are the reports having rdlc data in NAV2009R2 and working fine in RTC?
  • poppinspoppins Member Posts: 647
    Are the reports having rdlc data in NAV2009R2 and working fine in RTC?

    There is RDLC data but the the parts with code on that trigger don't display in RTC...
  • poppinspoppins Member Posts: 647
    Here is an example of the code in OnPreSection() trigger:
    MyRec.SETRANGE(x1,var1);
    MyRec.SETRANGE(x2,var2);
    
    IF MyRec.FINDFIRST THEN
    CurrReport.SHOWOUTPUT(TRUE);
    ELSE
    CurrReport.SHOWOUTPUT(FALSE);
    
    
    Where can I put that code???
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Is the report running same as classic in NAV2009R2?
  • poppinspoppins Member Posts: 647
    Is the report running same as classic in NAV2009R2?
    No, the data with code in the OnPreSection() trigger in Classic does not display in RTC...
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Then you need to modify the report logic in NAV2009R2 first and then import into NAV2013 once it is working fine in NAV2009R2 RTC.
  • clauslclausl Member Posts: 455
    Hi poppins,

    Section Designer belongs to Classic reports, and as you know Classic reports are not supported in NAV 2013, so all Section Designer code is deleted when you upgrade your report to NAV 2013. But if your report has RDLC layout in NAV 2009 and working, you should be fine, because the code you have in the Sections Designer is not supported in NAV 2009 either, when running a RDLC report. Only works when running Classic report. So really you should be fine if your RDLC report works.

    If not, a good place to put code from the section designer is on the OnAfterGetRecord on the Dataitem which is producing your lines for your dataset.

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • deV.chdeV.ch Member Posts: 543
    Since you try to hide the section based on conditions, you can transfer the result of the condition (the bool result of myRec.Findfirst) to the dataset.
    Then you can set the visibility (Property "Hidden") in the RDLC acording to your condition (eg: =Fields!<YourConditionFieldName>.Value)
Sign In or Register to comment.