0
votes

I have 2 datasets in form of lists (Share point) in my rdl in Visual Studio 2012.

I have BranchCode column as the common column in both my data sets. One tablix in my report where I am writing an expression for looking up BranchCode from dataset1 with BranchCode of dataset2. If it is true then I want it to retrieve the corresponding BranchCost value from dataset2.

I am able to write the lookup expression but final o/p is just a blank value. Can somebody please help me out with this?

1

1 Answers

0
votes

I always recommend casting your datatypes in expressions.

So what you should have is something like this:

=LOOKUP(Fields!BranchCode.Value, Fields!BranchCode.Value, Fields!BranchCost.Value, "DataSet2")

You would use the VB.NET functions to cast your values to be the same. Common examples are CSTR() - string, CINT() - int and CDEC() -decimal

=LOOKUP(CSTR(Fields!BranchCode.Value), CSTR(Fields!BranchCode.Value), Fields!BranchCost.Value, "DataSet2")

If it is a string you could also wrap it in the RTRIM() function to make sure there are no trailing spaces.

If you still have issues I recommend outputting the data in both DataSets into tables in the report. Run the report and inspect the data to ensure the DataSets contain the expected data. I also like to add special characters around strings in the table such as # so you can easily identify any leading or trailing spaces.