SSRS report randomly displays incorrect PONum and blank OrderDate

My custom POForm report style has an error when batch printing. If it is used to print a PO individually, all is well. When used to print a batch, some of the POs are printing with the following fields sometimes incorrect:
-PO Numbers (sometimes jump to next PO # on pages after first page of PO)
-Order Date (sometimes blank on pages after first page of PO)

The last batch was 45 pages and included 29 Purchase Orders. All look good until page 14, where on page 2 of the PO, the PO number changes. (It’s supposed to be 23661 but it shows 23662.) Then after that, PO numbers are incorrect on many pages (after the first page) on each PO.

SO_SSRS_PONumberWrong

SO_SSRS_PONumberWrongOnPage2AndBlankOrderDate

Must be something with the grouping, right, but I can’t find it and I’m afraid I’m making it worse. Can anyone point me in the right direction? In the meantime, my Purchasing Dept is having to print these individually, which is not ideal.

Attaching .rdl.
POForm_ACI.rdl (290.2 KB)

I’m using MS Report Builder v15.0.19210.0.
We’re in the cloud, Kinetic 2021.2.3

That is super strange Erin. It is getting the PO number from a hashtable that is created in each instance of a group.

Your groups are on the PO number so I am confused as to how this is happening.

Erin, will you try to mass print these using the base report style and see if the same thing is happening?

1 Like

Sure thing. Stand by…

And is this completely random or can you get it to happen every time you print that batch?

Good question, that I don’t know, but I will check…

UPDATE*** I’m heading into a meeting, so I may not get to update for a few hours. I will update as soon as I get a sec.

Thanks for looking!

1 Like

I just ran with the Std SSRS and the PO Numbers are all correct. I re-ran with my custom report and again, all are good until the 4th PO (pg 11), where the number changes on page 2 and the OrderDate is blank on page 2. I’m going to deep dive into the rdl. It’s got to be a little box somewhere with code messing something up, or something incorrectly set. This used to work! I’m going to find it. If you think of anything else, please update.

UPDATE**** I re-ran a mass print with the same PO’s and the report printed with the same exact errors, so it’s not random.

Purchase Order_4thPONumberIsWrongAndBlankOrderDateOnPage2OfPO.pdf (234.7 KB)

So it is only on page two of the PDF, but page one displays just fine?

Yes. In each instance of a problem, it is always on pages AFTER page 1.

The only thing I can think of doing is to allow the group to break. In other words, make sure that on the PONum group it doesn’t have “Keep Together” checked.

The PONum variable that is displayed on the top of the header is re-set each new PO group. On page two there is no group change, but for some reason it is changing.

It is odd that the standard report works, but yours doesn’t.

I think you can open an RDL in notepad++ if I am not mistaken? You could try to do a compare on both files to see what has changed.

1 Like

Would you please send me the base rdl for the PO form?

This is the main base rdl: POForm.rdl (269.2 KB)

Here is the custom rdl: POForm_ACI.rdl (290.2 KB)

I can’t quite find what is causing the issue, but the fact that the base works correctly is a sign that you may need to step back a bit and try to re-assess the customized form. I think it would have to do with grouping, but I don’t know how custom code executes when it is put in groups. I barely know how it works anyways.

I’m sorry I can’t be of more help.

I may just recreate it. Thank you for your replies!

Erin, the other weird thing you can try is to copy this textbox and put it in the last tablix row as well so that the PO number is set in two places.

Will you try this and let me know if it works ^^^ ?

Yes, I started to, but got called away. Working now, will update soon…

I just added that box to the bottom and got this error:

The custom rdl: POForm.rdl (292.3 KB)

Does the value of the box say this: =code.SetVarPONum(Fields!PONum.Value)?

I saw that when I copied it, it got changed to this =code.SetVarPONum

it should be =code.SetVarPONum(Fields!PONum.Value)

Trying it now…