KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Display pictures in the table/ Datatables #519

Closed Daniel Amamoo-Otchere opened this topic on on Nov 14, 2018 - 4 comments

Daniel Amamoo-Otchere commented on Nov 14, 2018

Hello Kool Team, May I know if you have an implementation of displaying a url as a picture in the table or Datatables?.

So far I searched and found none in the posts

KoolReport commented on Nov 14, 2018

You use the "formatValue" to return any text/html you want:

Documentation: Table formatValue

Best regards,

Daniel Amamoo-Otchere commented on Nov 15, 2018

Hello, Is this the correct implementation?. I tried this but it did not work.

   "applicant_picture"=>array(
		"label"=>"Picture",
		'formatValue'=>'<img src="c:\GBALogo.phg" height=20 width=20>'
),
Daniel Amamoo-Otchere commented on Nov 16, 2018

Hello, Still following up on the issue. Is my approach the correct way to display a picture?

KoolReport commented on Nov 16, 2018

The picture could not display if you put the real path ( server path) like above. It should be the url: something like this:

...
"columns"=>array(
    "image"=>array(
        "formatValue"=>"<img src='http://www.myhost/images/@value' />"
    )
    ...
)

So you have "image" column contain image name such as "picture.png", on each rows, the value will be fill into the @value so you will have full image src. It result in displaying the image inside table cell.

Hope my explanation is good.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None