A report problem.

aliennavaliennav Member Posts: 449
Hi all
I am designing a report.
I have declared 2 dataitems-->Customer and 2nd indented one i.e. contact(in which only person filter is applied)..Now, I am getting data like.>Customer body.
.
.
//////.
.

.
.All customer details
>>contact body>>>
.
.
.All contact details only of that customer.

NOW the problem is that i want this contact detail somewhere in between customer detail(where I have put ////).
Kindly suggest me how to achieve it.

Also,when I am trying to put source exp. in customer body which includes-->contact.name then I am gettin an error like this.----"The variable is not a record".
this is because system has not accessed the contact dataitem when working with cust. as it is the second dataitem.

Pl. suggest a solution.

Comments

  • biant123biant123 Member Posts: 29
    Hi aliennav,

    You can use Contact record variable to get the contact detail instead of using 2nd dataitem. Any reason of using 2nd dataitem?
  • DaveTDaveT Member Posts: 1,039
    Hi Aliennav,

    Your problem arises because there is not a direct link between customer and contact. You will need to add some code. Firstly declare a record variable for "Contact Business Relation" table 5054 and in the customer dataitem get the record for the customer. In the OnPreDataItem of the contact filter the contact on Company No. on the contact number found in the business relation e.g.
    if BusinessRelFound then
      Contact.setrange( "Company No.", ContBusRelRec."contact no." )
    else
      currreport.skip;
    
    where
    BusinessRelFound is a boolean if Contact Business Relation record exists
    ContBusRelRec is the record variable for Contact Business Relation
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • aliennavaliennav Member Posts: 449
    Hey!
    I found a different way of getting the desired format.
    I have declared all the data in the group header instead of body of customer.
    Then I have declared some data in the contact body.
    Then the rest of the data in the customer group footer.
    Thanx for ur help.
    :)
  • DaveTDaveT Member Posts: 1,039
    Good Work - Glad to Help :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • aliennavaliennav Member Posts: 449
    DaveT wrote:
    Good Work - Glad to Help :mrgreen:

    Thankx DaveT =;
Sign In or Register to comment.