Link POform SSRS to Memo table no value return issue

Hi,

I am trying to add the memo to the poform SSRS template. I successfully uploaded the SSRS report after I had added the table and fields in the data definition and adding the LEFT JOIN in the SSRS template (As shown in the Text below), but when I print the report no value is coming out even though there is Memo data for that particular PO number.

      FROM POHeader_" + Parameters!TableGuid.Value + " T1
      LEFT OUTER JOIN PODetail_" + Parameters!TableGuid.Value + " T2
      ON T1.Company = T2.Company AND T1.PONum = T2.PONUM
      LEFT OUTER JOIN RptLabels_" + Parameters!TableGuid.Value + " T4
      ON T1.RptLanguageID = T4.RptLanguageID
  LEFT OUTER JOIN Memo_" + Parameters!TableGuid.Value + " T5
      ON T1.Company = T5.Company AND T5.CategoryID = 'Version' AND T5.RelatedToFile = 'POHeader' AND T1.PONum = CONVERT(int, T5.Key1)"

Can anyone let me know what I’m doing wrong? I tested pulling table with the condition above and with just T1.Company = T5.Company and still its retrieving nothing. It would be great help.

Thanks in Advance,
Mei Mei

Just to add detail, I tested in the SQL on this and was able to use the cast and convert to link the Erp.POHeader table to the ICE.Memo table and pull out the memo record from a specific PONumber. However when I do this in the SSRS Dataset, no data is being pulled.

Does Epicor block the ICE table from being printed?

I have solved this and got it to appear.

1 Like

Well don’t leave us hanging, what was it?

Oh sorry, I’m pretty new to using this forum so I didn’t even realised that the post was actually viewed by people :sweat_smile:

I’ll just write the scenario that required me to link the Memo and the solutions for it below. The trials and error was too much and too long and I rather not remember my poor eyes dying from squinting at codes and trying to figure out the error that doesn’t even comes out as one. :melting_face:

Just a summary, this problem started due to user wanting to track the Purchase Order version as they do make last minutes changes to it. I’m not sure if there are any Modules that tracks document but they do not have any so we use a workaround where the Memo is used to track the version and user will manually add a new memo for a new version of a PO.

Note: I’m doing this for poform report by standard epicor and basically customizing it to add an additional table and field, not by BAQ report. You will probably need to adapt it if you want to use for other data definition.

Issue Faced 1: PO is not link to Memo table. The Data Definition linked tables doesn’t have it as well.
Solution: Manually linking the tables.

Note: To not disturb standard, I usually make a copy of the data definition and the report style that I am going to customize.

Step 1:
In the data definition for the poform, Add new Table and then add the Memo table.

Step 2:
Enter the Memo table, and uncheck the Exclude Column out the following fields. Description on why is written below. The bolded fields are the mandatory ones that I needed.

Company - Required for linking later in the Data Def
CategoryID - Optional for filtering later in SSRS if you use Memo in
Key1 - The linkage that holds the PONum in the Memo table. Note that this is a nvchar field so you will get an error if you try to link using Data Def Relationship
MemoDate - Optional for if you want to pull data out
MemoText - Optional for if you want to pull data out
MemoDesc - This is the Memo Title that will be seen in the report (Version 1, etc, etc…)

Step 3:
Next, after excluding the columns. I create a New Relation.
Below is the Details of the Relation.

image

And this is the field that I connected in the Relation.
Note: Yes, there’s only 1 field.

There is an additional field to connect, which is the POHeader.PONum field = Memo.Key1 field. This will need to be done in the SSRS template because of the different types of field as PONum is an int type and Key1 is nvarchar type.

Step 4:
Download and open the poform SSRS template and open it with a report builder.

Open the POHeader query formula.
image

Add the Joins for the Memo table below. The table is T5 for mine.

LEFT OUTER JOIN Memo_" + Parameters!TableGuid.Value + " T5
ON T1.Company = T5.Company AND T5.RelatedToFile = ‘POHeader’ AND cast(T1.PONum as nvarchar) = T5.Key1

Since, mine is referring to the POHeader in Memo, I have filtered out the RelatedToFile to POHeader. If your using a different one then you would need to check in the Memo for which it is in RelatedToFile.

And FINALLY the linkage to PONUM as you can see I have put a cast at PONum
which wraps the PONum field to become nvarchar instead of int.

I tried casting Key1 to int instead but that was where I got the issue where blank results came back. So, it has to be casted at PONum.

After that, I added T5.MemoDesc, T5.Company AS MemoCompany , T5.MemoText before the FROM POHeader_" query as shown below.

Step 5:
I added the fields in the Dataset Property.

And pull the data to the report with the function Last. This is so that it takes the last version value of that PONum Memo. So if user has created and added 3 memo to indicate 3rd version, it will pull out the latest added when printed as shown below.
image

image

Hope this helps.

Warm Regards

2 Likes

Holy crap what a reply. I could have used this yesterday to help someone.

Awesome.