By using this website, you agree to our Terms of Use (click here)
I would like to change the company logo image based on the Sales Order type field.
If I could get it stored where I can find it later, then I believe I could build a formula for the value property that would print one image for Sales Order type A and another image for Sales Order type B. I know how to tie an image to a branch, but we only have one branch. I am not sure how/where to store an image in the database so that I can access it in the report.
Can you tell if there is a way to do this?
Hi DWS253,
Would it be ok to load the logos directly into the report?
Or do you want to load them someplace else so you can use them on multiple reports?
Here is how you could upload multiple images to the report itself:
- Go to the report properties, then Data -> EmbeddedImages, and click the ... icon
- Click the New image ... button. You can do this multiple times to upload multiple images:
- Then, when you add a PictureBox to the report, you set Data -> Source to Embedded
- Clicking the drop-down in Data -> Value will show you a drop-down with all of the embedded images listed
- In your example, you would add multiple PictureBox images to the report and use Behavior -> VisibleExpr to control when each one prints (they will print when this evaluates to True)
Acumatica Version 6.10.0472 used when composing this response
Also, I think I found a way to put the images in the database:
- Attach your images to the Order Types screen for each order type
- On the PictureBox, set Data -> Source to Database and Data -> Value to =[SOOrderType.NoteFiles]
Note: If you attach more than one image to an Order Type, it grabs the first one that you attached (nice that it's so smart). I'm not sure why you would attach more than one, but I was curious so I decided to test it.
Acumatica Version 6.10.0472 used when composing this response
I wanted to provide an update. I finally got around to testing your suggestion. Works well.
One thing I wanted to add is that even though the PictureBox.Data.Value property does not have an ellipsis button to open the builder dialog, you can build a formula and paste it in as the value.
Here is the value I used to pull the image from the Order Type for the "SP" order type and from the Branch for everything else.
=IIf( [SOOrder.OrderType] = 'SP', [SOOrderType.NoteFiles], [Branch.LogoName])
Thanks for your help.
Nice! I didn't realize that you could put a formula in there. Thanks for pointing that out. And thanks for sharing the formula.