Displaying jsignature in Report PDF

1 Answer 14 Views
Binding Report Designer (standalone)
Taras
Top achievements
Rank 2
Iron
Iron
Veteran
Taras asked on 09 Dec 2021, 03:58 PM

I've used jsignature (https://willowsystems.github.io/jSignature/) in my ASP.Net Core app to capture a signature made in the app.

It is stored in the SQL database in a varchar(2000) field.  I can display it back in the app afterwards.

How do I get it to display in the Report PDF.  If I include the field (from the datasource), it shows as follows when previewed in the standalone report designer (R3 2021)

I've read elsewhere in Teleirk forums that it can be bound to a picture box but I don't see how to bind the picture box to a report field.

I don't need to capture the signature in the report pdf, just include it.

1 Answer, 1 is accepted

Sort by
0
Taras
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 13 Dec 2021, 08:28 PM

This may not be the most elegant solution, but it works.

Add a field to table to hold the image

When saving the signature in the View, add a line to create the signature image and store it in the ViewModel (for saving to database)

                var svg = $("#divP1Signature").jSignature("getData", "svg");
                viewModel.set('p1SignaturePNG', "data:" + svg);

You can then bind the signature field in the report source to the image in the report.

In my case, I didn't want the image box to display if it was going to be empty.

One thing to keep in mind is that the image box size must correspond to the View's signature box size specified. so if you have
$('#divP1Signature').jSignature({ 'width': '500', 'height': '100' }); the image box size is 5.2in, 1.1in.

Tags
Binding Report Designer (standalone)
Asked by
Taras
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Taras
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or