How to show Blob data in Custom JS Chart?

Pratap Singh shared this problem 11 months ago
Defect Logged

Hi ,

We need to show logo in our custom JS chart , for that we have a binary field in Database but when trying to render Binary data to image it is appending binary data field as follows in both cases (fomatted and raw data) :


data.logo[0].row_data

<.img style="width: 100%;" src="data:image/jpeg;base64,undefined" alt="logo">


data.logo[0].formatted_data

<.img style="width: 100%;" src="data:image/jpeg;base64,<Binary Data>" alt="logo">


How to fix this?

Regards

Pratap

Comments (7)

photo
1

Thanks Pratap,

I have replicated this and raised a defect to address this:

#10289

In the meantime, your best bet would probably be to create a free-hand SQL calc field to cast this to a text data type.

Let me know if you have any question on this.

Regards,

Nathan

photo
1

Hi Nathan,

Thanks for the revert,

We have tried the solution suggested by you but it doesn't work, as text field not able to fetch full Blob field length.

Regards

Pratap

photo
1

Hi Pratap,

Another work around here is to store these images in the Yellowfin ROOT directory and then access them by path in the JS chart:

<img src="/myimage.png">

Will this work?

Nathan

photo
1

Hi Nathan,

Thanks for the suggestion we are currently using this workaround but in some specific cases we need to pick from Blob field only.

regards

Pratap

photo
1

Hi Pratap,

Unfortunately I cannot think of anything else that might work here other than writing your own query in JS... Once the devs get a chance to look at this they may have a better work around.

Sorry for the troubles.

Nathan

photo
1

Hi Nathan,

Thnks for the update,

hope defect will be resolved soon.

Regards

Pratap

photo
1

Hi Pratap,I will keep you up to date on any progress.

photo