Report with Blank Fields

ryanatworkryanatwork Member Posts: 47
edited 2010-10-19 in NAV Three Tier
Hi All,

I have copied the standard Check report to the 50000 range to modify as a custom object.

I have kept the GetData and SetData functions to pass values to the Footer for fields that print on the Cheque.

So in the body of the report I have a hidden field that is set with :-
=Last(Fields!DescriptionLine_1_.Value) + Chr(177) +
Last(Fields!DescriptionLine_2_.Value) + Chr(177) +
Last(Fields!CheckToAddr_1__Control7.Value) + Chr(177) +
Last(Fields!CheckToAddr_2_.Value) + Chr(177) +
Last(Fields!CheckToAddr_3_.Value) + Chr(177) +
Last(Fields!CheckToAddr_4_.Value) + Chr(177) etc etc.

In the footer I have :-
=Code.SetData(ReportItems!CheckToAddr.Value,1)

But when I try do a
=Code.GetData(3,1)

I simply get a blank value.

When I look at the dataset in Report Preview->About this report there are two rows in the dataset.

The last row for the dataset does contain the values that I am looking for.

Why does Last not work ?

Any ideas appreciated.

R

Comments

  • deV.chdeV.ch Member Posts: 543
    Are you sure that the Setdata Textbox is located before the Getdata Textbox? Try to move the Setdata box on the very left and top of the footer area
  • ryanatworkryanatwork Member Posts: 47
    Thanks for the reply.

    Yes it is the first field in the top left hand field
  • BeliasBelias Member Posts: 2,998
    There are some things to check:
    1. The "getdata" textbox must be PHYSICALLY under the "setdata" textbox
    2. set an all around red border in your footer section, in order to see if it is fully printed
    3. post the getdata and setdata function here, please
    after you checked all this, if it still not work, we'll try something else
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • deV.chdeV.ch Member Posts: 543
    as i see you want to get this value : Last(Fields!CheckToAddr_1__Control7.Value)

    Could it be possible that you want to retrieve the value of the dataset field "CheckToAddr_1.Value"? (and accidently took the one with __Control7 in the name?)

    What about the other values you Set, can you retrieve their values?
  • ryanatworkryanatwork Member Posts: 47
    Hi All,

    Thanks again for the quick responses.

    1. The Get and Set Functions are copied from the Standard Check
    Shared Data1 as Object
    Shared Data2 as Object
    Shared Data3 as Object
    
    Public Function GetData(Num as Integer, Group as integer) as Object
    if Group = 1 then
       Return Cstr(Choose(Num, Split(Cstr(Data1),Chr(177))))
    End If
    
    if Group = 2 then
       Return Cstr(Choose(Num, Split(Cstr(Data2),Chr(177))))
    End If
    
    if Group = 3 then
       Return Cstr(Choose(Num, Split(Cstr(Data3),Chr(177))))
    End If
    End Function
    
    Public Function SetData(NewData as Object,Group as integer)
      If Group = 1 and NewData > "" Then
          Data1 = NewData
      End If
    
      If Group = 2 and NewData > "" Then
          Data2 = NewData
      End If
    
      If Group = 3 and NewData > "" Then
          Data3 = NewData
      End If
    End Function
    

    2. The Get is indeed under the set.
    3. deV.ch I am trying to get Last(Fields!CheckToAddr_1__Control7.Value)
    4. I am printing the whole footer.


    The interesting bit that I have noticed doing this for one of fields in the footer :-
    =Code.GetData(3,2)
    

    This is defined by :-
    =CStr(Last(Fields!TotalLineAmount.Value)) + Chr(177) +
    CStr(Last(Fields!CheckNoText.Value)) + Chr(177) +
    CStr(Last(Fields!CheckDateText.Value)) + Chr(177) +
    CStr(Last(Fields!CheckAmountText.Value)) + Chr(177) +
    CStr(Last(Fields!VoidText.Value))
    

    I get a value that is in the first row of the dataset !

    WHY ? ](*,)
  • BeliasBelias Member Posts: 2,998
    try to make your "source" textbox (the one with the chr(177)) visible, and see what you get...you're probably putting the textbox in a wrong place :-k
    also, what field are you passing to the setdata? is it the correct one?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • ryanatworkryanatwork Member Posts: 47
    Strange.

    Looking at the dataset in the About this report page I cannot access any values from the Second row in the dataset.

    I have shown where I assemble the string and it is all blank except for Chr(117)

    In the standard Cheque for the same Journal Line there are also two rows of data but it prints perfectly.

    ???
  • BeliasBelias Member Posts: 2,998
    Looking at the dataset in the About this report page I cannot access any values from the Second row in the dataset.
    what does it mean?

    can you post a screenshot of the rdlc layout and the classic layout, too?(please indicate what are the involved textboxes)
    i think your dataset is populated wrongly...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • ryanatworkryanatwork Member Posts: 47
    Hi Belias.

    I have attached the screen shots of the layouts.

    The simplest example is that I cannot get the Cheque Description line 1.

    In the dataset you can see that it is empty on the first row but I have data in the last row.

    When defining the string in the body I am using the Last function to get the last row of the Dataset.

    Any ideas ?
  • BeliasBelias Member Posts: 2,998
    did you put the 2 tables in the body section within a list?(take a look at standard check printing)if so, check the grouping/filtering/sorting, too...
    also take a look at the properties of the rectangle in the footer for the standard check printing...there's probably something you forgot, there...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.