Priority Dispatch Report Add Days in Operation - Help Needed

I was asked to add days in operation/ days in the department to our priority dispatch report.

I am currently using this calculation:

=if(IsNothing(max(Fields!PayrollDate.Value)), "0",DateDiff(DateInterval.Day,max(Fields!PayrollDate.Value),Today()))

This works as long as time has been clocked to the operation. The issue now is that if time hasn’t been clocked to the operation we still want it to show that job has been in the department x amount of days. What I wanted to do next was grab the last clock in date for the prior operation and do the datediff of that vs today. However, I have not yet found a good way of calculating the previous operation, and even after that has been calculated how do I then select the max clock in date for that operation?

Thanks in advance for the help!

I wonder if you might be able to add JobOper to the data definition?
If so, then JobOper.LastLaborDate might be easier than trying to calculate your days?

But… you’d still have to figure out how to reference the previous op.

@bordway,

JobOper is part of my current data definition. The JobOper.LastLaborDate does not show in the exclusion list, but I do see it when I build a quick baq.

The next question I have is how do I build a subreport, and does it have to be based on the same information that the current report uses? I would like to create a new ssrs report that gives all jobs, operations, and maxpayroll date and use the current operations on our priority dispatch as a filter for the subreport. Then take the top n of those results and pass its max payroll date back to the primary report.

Assuming JobOper is in the RDD, then I’d guess the field just isn’t included in the expression in SSRS. Might take some tinkering but you should be able to edit the expression in Report Builder, (it’s not exactly user friendly).
There are some screenshots related to editing the expression in Report Builder in this thread: Need Help Adding JobMtl.DocUnitPrice to SCTicket Service Call Center - #22 by bordway

If you search this site for ‘subreport’, I think there are some pretty good examples.
I also tend to use Google for a lot of SSRS “stuff”. While I tend to only search this site for the more Epicor specific things related to SSRS.

@bordway & @ckrusen,

Now we are getting somewhere! Got a BAQ report built with the data I need then added a parameter and embedded the baq report into my original report. New problem is that I now get the “ERROR: Subreport cannot be shown” message.

Was reading here about how it might not be possible to use subreports on a BAQ report.

Are we not allowed to use BAQ reports as subreports?

If we are then my next question is can I have that subreport, which is a matrix, shown inside another matrix, which is what the original report is? The subreport matrix has all other fields hidden beside the section that I am after, so I figured it would work just fine. If now how should I go about handling my data instead?

An additional problem I have run into is that report builder seems to have a character limit on query expressions. I cannot add any more changes or fields to the data expression for our priority dispatch report. Has anyone else had this problem, or know of away around this issue?

Hi Dylan;
did you get an answer to this question? I’m very new to Report Builder and modifying SSRS reports and have just run into this. I’m trying to modify the Order Acknowledgement to add a field that I can filter on. I want to not print closed releases. Hoping you were able to get an answer to this question since I’m having that issue exactly.

@vfeldt,
The best way I found to get around this was to open up the .rdl file using a program called Notepad++. This will allow you to modify the data expression without running into the character limitation.

When you open it up youll look for the select statement that doesnt mention literals/labels. From there you can add tables, relationships, and fields as needed. Below is a screen shot of what it looks like in a subquery of our MethodMaster report.

Note that you will have to make these modifications to the the report/subreport in question, not all parts of the report.

An additional thing I would like to ask is if you used the Sync Dataset button on the report in question. If so that is what was diagnosed to be the problem with the report I was struggling with in the past. The Sync Dataset greatly bloats data expressions.

Thank you Dylan!
I’ve been able to make the necessary edits. As for your questions, I had NOT used the Sync Dataset Button.

Thanks very much for your suggestion/help.
val

1 Like