I’m new to report writing and am struggling with GetData/SetData.
(I have searched this forum and found things like mibuso.com/…/ but these refer to existing setups, not creating a new one)
I am amending Report 10532 ‘Remittance Advce - Entries’. I have already altered 10572 ‘Remittance Advice - Journal’ and we would like 10573 to look more like this. 10572 has a Header, Body and Footer, whereas 10573 just has a Body. So - since I have to use GetData in the Header - I have added the header and footer sections in Visual Studio and copied over the following from 10572:
Hidden Header textbox with the Expression =code.SetData(ReportItems!CompanyInfo.Value,1)
Hidden Body table with three textboxes, of which 2 and 3 are blank. Textbox 1 is called ‘CompanyInfo’ and has the following values:
=Fields!CompanyName.Value + Chr(177)
- Fields!CompanyInfo__VAT_Registration_No__Caption.Value + Chr(177)
- Fields!CompanyInfo__VAT_Registration_No__.Value + Chr(177)
- Fields!VendorAddr_1_.Value + Chr(177)
I then changed the above code to just =Fields!VendorAddr_1_.Value just as a test (this is a valid 10573 DataSet Result for 10573)
When I try to Compile the report I get the error:
Error while validating RDL content:
The Value expression for the textbox ‘textbox33’ contains an error: [BC30456] ‘SetData’ is not a member of ‘ReportExprHostImpl.CustomCodeProxy’.
‘textbox33’ is the Header code =code.SetData(ReportItems!CompanyInfo.Value,1)
I also added a textbox with the GetData code of =code.GetData(1,1) with the intention of pulling through the first line of the Vendor’s address in the format of the working 10572. I get a very similar error but it says GetData not SetData and refers to the relevant textbox. I have since deleted this until I sort out the SetData issue
By the way, am I right in assuming that the ‘,1’ is there to show that the 1st of the three hidden Body textboxes is to be referenced, and that if there were only one, then this would not be needed?
Can anyone explain what I am doing wrong?