Acumatica allows for the attachment of one or more images on any master or transactional data record.
Typically with the Report Designer when there is more than one detail record the information is printed vertically, with one row displayed in each detail section. However you can save space and make reports prettier by printing the images horizontally. Some typical use cases are a product catalog, or images associated with a purchase order line.
One way to accomplish this is through the use of subreports, however creating and maintaining multiple subreports can be awkward.
A more streamlined way to do this is using variables.
Note that in order for this trick to work you do have limit the number of images per record to some fixed number. In this example I’ve limited the number of images per stock item to four.
- First configure the schema, including the NoteDoc and UploadFile data access classes. The UploadFile.Name field should normally be filtered to include images of a particular format such as jpg or png. You’ll need to specify this format later when configuring the PictureBox control.
-
Next add a group, in this example we’re grouping on the InventoryID.
-
Edit the collection of Variables in the detail section of the report. The $cnt variable is used to keep track of the number of pictures. Depending on the value of $cnt, the UploadFile.Name field is assigned to either $img1, $img2, $img3, or $img4. The $cnt variable is reset to 0 for each stock item group.
-
Add a PictureBox for each of the images.
-
The Value property of the PictureBox references the corresponding variable. Be sure to set the Visible property to hide the PictureBox if there is no image.
-
The final output will look something like this:
A sample of the rpx file is attached.
You can use a similar trick to print other types of detail information horizontally.
Happy reporting!
Laura