Using image data saved in WebCore in VCL application

Hi!

We use a WebCore application to retrieve customer data. We also save a customer signature as Base64 data to a blob.

We also have an Aurelius (VCL) application that is used for reporting - we use Report Builder.

I have a problem that I don't know how to use the Base64 saved picture of the signature to display it in the Report builder report. RB has a component to display an image, but it expects a field that has the image, I think saved as raw format (like the Delphi's TDBImage component).

Is there a way to use Aurelius to get the image suitable to use with classic Delphi components like TDbImage?

That's up to Report Builder, you should check if it has a feature to read binary data from a blob64 value.

Other than this, you should then save your binary data in raw format to the blob database field, not as base64 content.

One thing you can do, if you are using TAureliusDataset, is create a transient property in your entity class like this:

  property RawContent: TArray<Byte> read GetRawContent;

and then implement it like this:

function TMyEntity.GetRawContent: TArray<Byte>;
begin
  Result := DecodeBase64(YourBase64PropertyContent);
end;

Then with TAureliusDataset you can add a field RawContent, and that field can be read by Report Builder as raw binary value.

1 Like

Thank you. Just one question - where do I find the function DecodeBase64 ? I tried Bcl.Utils and searching the documentation and forum, but I cannot find it.. :)

Found it - it's TBclUtils.DecodeBase64 and it's in Bcl.Utils :)

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.