Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Custom Report - Thumbnails not working

fredform
Advocate

Custom Report - Thumbnails not working

fredform
Advocate
Advocate

Hi,

 

I'm trying to make a custom report and are having some difficulties getting the Thumbnails from my BOM to populate the report.

 

I have followed the instructions given in the Custom Reporting in Vault 2019 but I must be missing something.

So far I have:

  • Included "Thumbnail" as a property when generating the template from the Autodesk Report Template Utility
  • Inserted "Image container" to the corresponding row
  • Set the "Image source" to Database.
  • Set the field to the following expression: =Convert.FromBase64String(Fields!.Value)
  • Tried including the string "conversion code" both under Report Properties > Code and under the expression field mentioned previously but neither has worked.

 

String "conversion code" as written in the article/link above:

 

 

string base64string;
using (var stream = new MemoryStream())
{
 image.Save(stream, ImageFormat.Bmp);
 base64string = Convert.ToBase64String(stream.ToArray());
}

 

 

 

 

 

var val = propDef.Typ == DataType.Image ? Convert.ToBase64String((byte[])propInst.Val)
 : propInst.Val;

 

 

 

 

Thumbnail settings.png

 

If I remove the image container and thumbnail code the BOM report template works so I know its not something else in the template that makes it trip up.

 

Very grateful for any help in sorting this out! 

 

Best regards,

Fredrik

0 Likes
Reply
Accepted solutions (1)
461 Views
3 Replies
Replies (3)

a.murphyYHDY8
Enthusiast
Enthusiast

Alternate solution to this issue, doesn't utilise report functionality:

 

From the Bill of Materials tab in the item window, 

Use customise view to show required columns (including thumbnail)

First select File – Page Setup.

Set the page to something bigger like A3 Landscape and click OK.

Then select File – Print Preview.

In the Print Preview window select File – Export Document – XLSX file.

Excel document will be created containing thumbnails as images.

 

Not certain how to solve the issue in the built in reporting functionality.

Hope this is helpful

Markus.Koechl
Autodesk
Autodesk
Accepted solution

I think you might have missed the property name in the expression "Convert.FromBase64String(Fields!.Value)". Comparing a default template, you see: 

Convert.FromBase64String(Fields!DocThumbnail.Value)

I am not sure why you should need the conversion code additionally.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe

fredform
Advocate
Advocate

Thank you Markus!

It was a typo causing the thumbnail not to load, following your recommendation it now works:

 

=Convert.FromBase64String(Fields!Thumbnail.Value)

 

Thanks a lot!

/F

0 Likes