Can someone share an example of user functions in blazor

1 Answer 117 Views
PictureBox Report Designer (standalone) Report Parameters Report Viewer - Blazor
Ed
Top achievements
Rank 1
Iron
Veteran
Iron
Ed asked on 23 Sep 2022, 12:09 PM

Hi,

I desperately need some guidance. I have a trdx that is working perfectly. However, we are porting over to use Azure.

I need to be able to set a picturebox's image at runtime. I used to do this via itemdatabinding event, but I believe that has been deprecated in favor of  user functions. If I have a PictureBox on my report and I want to set the value to an Image (not a path), what code do I need to do this? How do I get access to PictureBox1 so I can set it's value?

Any guidance would be great as I am dead in the water.

Thanks ... Ed

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 28 Sep 2022, 07:40 AM

Hi Ed,

Indeed, in the TRDX/TRDP reports you cannot have event handlers or other code as these reports are declarative XML report definitions.

Note that you may pass the image directly through a Report Parameter if it is in SVG or Base64 string format that we now support. Alternatively, you may pass an image identifier as a Report Parameter, and resolve it to a byte[], Image, or another supported format with a User Function. These approaches allow you to resolve the image directly in the report definition.

The other solution would be to modify the report definition in run time and add the image to the PictureBox, or add an event to the report, etc. This may happen in a custom ReportSource resolver. The video tutorial Utilizing Custom ReportSource Resolver to render XML reports in the HTML5 Report Viewer may also be helpful if you decide to undertake this approach.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Ed
Top achievements
Rank 1
Iron
Veteran
Iron
commented on 28 Sep 2022, 09:39 AM

A thousand thanks! Converting the parameter to a base64 string did the trick. Talk about magic sauce! Sheesh, I never would have figured that one out myself.

Thanks again ... Ed

 

Tags
PictureBox Report Designer (standalone) Report Parameters Report Viewer - Blazor
Asked by
Ed
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Todor
Telerik team
Share this question
or