NAV 2013 - Report Header

Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
edited 2012-07-31 in NAV Three Tier
Hi guys I've started playing with Report Designer for NAV 2013.
Time ago I read with NAV 2013 is possible to print Fields in the header without calling them with "ReportItems!" method or using "SetData/GetData" functions.
This afternoon I wanted test it.
I put the following code in the header:
=Fields!CompanyInfo_Name.Value 
And it worked.

After that I opened standard "Sales Invoice" and I found that GetData and SetData still used.
I thought they were not needed anymore but I can't find a way to avoid them if header/footer are "dynamic" like Invoices.

Testing I created a simple report wit a List in the body grouped by "Customer_No" field.
I inserted page break for every customer and then I placed 4 textboxes in the header with No, Name, Address and Search Name from the customer table.
Launching report for all customers I expect to see information in header to change but they still on the first record.

My question is: is there a way to print a "dynamic header(or Footer)" without the need of GetData/SetData fucntions?

Thank you very much,
Rik
~Rik~
It works as expected... More or Less...

Comments

  • ara3nara3n Member Posts: 9,256
    The RDLC v2008 handles

    Fields!CompanyInfo_Name.Value



    as

    First(Fields!CompanyInfo_Name.Value);

    So it will always return the first record. And in the footer it works as Last( Fields!CompanyInfo_Name.Value);
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    ara3n wrote:
    The RDLC v2008 handles

    Fields!CompanyInfo_Name.Value



    as

    First(Fields!CompanyInfo_Name.Value);

    So it will always return the first record. And in the footer it works as Last( Fields!CompanyInfo_Name.Value);
    Do you confirm SetData and GetData are needed to print "Dynamic" headers?
    ~Rik~
    It works as expected... More or Less...
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    No, as far as I know not. They should be removed in the final release. I just don't know if they will make it.
  • ara3nara3n Member Posts: 9,256
    Do you confirm SetData and GetData are needed to print "Dynamic" headers?


    no you can have dynamic values

    for example

    =iif(Globals!PageNumber = Globals!TotalPages,Fields!ItemNo.Value,Fields!ItemDesc.Value)

    it will print item no description on last page and other pages as item no. You will need to send your dynamic data as columns on the first row.
    You could build your text as comma delimited in nav and in RDLC parse it it out.
    The only limitation is that you can only get from first or last row.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • deV.chdeV.ch Member Posts: 543
    Well then you will still need GetData / SetData to show Customer Informations like Addresses in the header when you print mor then one Invoice (or whatever document)?
    Or how would you solve this if you can only access first or last row? I can only think of even more ugly workarounds then the GetData/SetData already is...
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    If I understood well the report designing could change again..
    Well... we will see and in the meanwhile we continue with our dear SetData/GetData.
    ~Rik~
    It works as expected... More or Less...
Sign In or Register to comment.