Display previous operation on Material Tag in SSRS

I am trying to display the previous operation on the Material Tag. When the Material Tag is printed at the end of an activity, it displays the operation that the Material Tag and related parts will be going to next. I would like to display the operation that is before that (i.e. the operation where the Material Tag is being printed from).

I tried to set up my query in SSRS like this: Previous Operation in BAQ

However, I am getting a syntax error and think it might have something to do with the RDD only having one JobOper table (I need a second one for the subquery).

Any advice?

Mr. Fred: I added a BPM to intercept the “Report Quantity” and I am forcing the “Next Opr” field to hold the Current operation.

That way your RDD will be able to display the correct Op codes and descriptions.

I went round and round with Epicor on this one - Epicor changed their logic and I tried to get them to change it - no surprise - my whimpers went in-noticed.

Thanks for the reponse Dave. I actually ended up solving this myself.

I removed the relationship between MtlTags.OprSeq and JobOper.OprSeq, then passed the full list of JobOper.OprSeq to a subreport where I sorted that it in descending order, set JobOper.OprSeq to be less than MtlTags.OprSeq, and then used a Top N = 1 filter to only choose the last operation before the MtlTags operation.

If anyone else wants to implement this, I would happy to go into more detail.


I could use more detail. I’m also trying to get the previous Op but it keeps using the current.
I keep getting 300 when I select TOP 1 in the SQL Query and I get the same Op as the query Op when I use it in a BAQ between just LaborDtl and JobOper.

Any way I could get that BPM ?

Mr. Jeremy: I will try to find it - it’s been a while.


Looking for this as well. Were you able to find a solution?

Any luck with finding that?

Mr. Jeremy: I found the EndActivity BPM – could not find the Report Qty BPM.

Found the Quantity BPM. Exact same logic as the EndActivity – just uses a different method:

It’s been a while since I’ve been able to revisit this. Thank you so much Dave this works great! I really appreciate it. I have been trying different ways to pass the data from the end activity or rpt qty form but I am still very new in C#.

Sorry, it what? I’ve been tasked with adding the next operation to this label. It sounds like you are saying it’s already there, but I can’t find it. This is Report ID “MtlTags”, report style “Standard - SSRS”, right? Your link points to a BAQ which confuses me as I don’t see any reports for material tags that use a BAQ.

If I just completed operation 10, and go to print tags, it will print operation 20 on the tag by default, because that’s the next operation that will be working on the part. Operation 20 would work on the part, complete it, and print a tag with operation 30 on it. That is the standard functionality.

I was just using the BAQ link as an example of the logic I was trying to implement to find the “previous” operation, i.e. the operation at which the tag would be printed.