KoolReport's Forum

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

Displaying multiple images #1611

Open Richb201 opened this topic on on Sep 3, 2020 - 3 comments

Richb201 commented on Sep 3, 2020

I have a table that contains two main fields; description and file_url. file_url is the path to an image. I tried doing this within a table shown below.

Table::create(array(
    "dataStore"=>$this->dataStore("pdfs"),
    "showFooter"=>true,
    "columns"=>array(
        "description",
        "file_url"=>array(
            "cssStyle"=>"text-align:right",
            "prefix"=><?php echo base_url();  ?>,
        )
    ),
    "cssClass"=>array(
        "table"=>"table-bordered table-striped table-hover"
    )
));

What this results in is show in the attached image as the path rather than the image. see "11.pdfs". Please advise. Just to test the image I created this, and it seems to display the image fine.

    <body>
    <img src="<?php echo base_url();  ?>assets/uploads/8d7a9-Screenshot-from-2019-05-04-09-58-25.png" />
    <img src="<?php echo base_url();  ?>assets/uploads/files/step-functions-dg.jpg" />
    </body>

KoolReport commented on Sep 7, 2020

This line is not correct:

    "prefix"=><?php echo base_url();  ?>

You should do:

    "prefix"=>base_url(),
Richb201 commented on Sep 7, 2020

Thx

Richb201 commented on Sep 8, 2020

This is just showing an empty box.

Table::create(array(
    "dataStore" => $this->dataStore("pdfs"),
    "showFooter" => true,
    "columns" => array(
        "description",
        "thumbnail_url" => array(
            "formatValue"=> "<img width='250px' height='100px' src='".base_url()."/assets/uploads/thumnbnails/@value' />"
        ),

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
None yet

None