KoolReport's Forum

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

Card value(s) #1418

Closed George opened this topic on on May 2, 2020 - 5 comments

George commented on May 2, 2020

Hi ,

is it possible to return more than one value in a card ? eg a custom query that returns one row of data ?

George

KoolReport commented on May 2, 2020

Since the Card display a single value, so even though your query may return a series of data, it will take the first value.

One question: So let say if possible that value received array of number. How would you want those number to be display on the card.

I ask this question because I would like to see how you would like to display using card. If you could provide a drawing, or explanation of use case, that's would be great!

George commented on May 2, 2020

Thanks for replying ,

I was thinking something that looks like this :

    FILM NAME

    DIRECTOR
     YEAR

Based on the films example table in codeigniter test database. It will come from a left join query actually the first value is from the master table and the two other values from a detail table.

KoolReport commented on May 3, 2020

I think it is matter of design and css only. You can make a card by yourself and fill it with your own data. Let say you have a dataStore, each rows contains film name, director and year, you can do like this to list all information:

<?php foreach($this->dataStore("film") as $row):?>
<div class="card" style="width: 18rem;">
  <img class="card-img-top" src="<?php echo $row["film_image_url"]; ?>" alt="Card image cap">
  <div class="card-body">
    <h5 class="card-title"><?php echo $row["title"] ?></h5>
    <p class="card-text"><?php echo $row["description"] ?></p>
    <p class="card-text"><?php echo $row["director"] ?></p>
    <p class="card-text"><?php echo $row["year"] ?></p>    
  </div>
</div>
<?php endforeach; ?>

Here is more info about the Bootstrap Card.

Hope that helps.

George commented on May 3, 2020

Thanks for directing me

KoolReport commented on May 4, 2020

You are welcome :)

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
solved

None