KoolReport's Forum

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

How can i apply localization with different font family in laravel #775

Open vudoc opened this topic on on Apr 3, 2019 - 3 comments

vudoc commented on Apr 3, 2019

My Php view,

<?php

use koolreport\widgets\koolphp\Table;
use \koolreport\datagrid\DataTables;
use \koolreport\widgets\google\ColumnChart;
?>
<html>
    <body style="margin:0.5in 1in 0.5in 1in">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" >

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
        <div class="page-footer" style="text-align:right">{pageNum}</div>
        <div class="text-center">       
        </div>
        
        <style>
            @media print
            {
                .table-striped > tbody > tr:nth-of-type(odd) > td {
                    background-color: #f9f9f9 !important;

                }
                .table > thead > th {
                    background-color:#216eb7 !important;
                }

                .table {
                    page-break-inside:avoid !important;
                    page-break-after:auto !important;
                }
            }
 
        </style>
        <hr/>

        <?php
        ColumnChart::create(array(
            "dataStore" => $this->dataStore('demands'),
            "columns" => array(
                "project_title" => array(
                    "label" => "Project Nmae (Implementation Period)",
                    
                ),
                "project_cost_total" => array(
                    "label" => "Total",
                    "footer" => "sum",
                ),
                "project_aid" => array(
                    "label" => "PA",
                    "footer" => "sum",
                ), 
            ),
        "cssClass" => array(
        "table" => "table table-hover table-striped table-bordered"
    ),
            "width" => "220%",
        ));
        ?>     

        <?php
        //end
        Table::create(array(
            "dataSource" => $this->dataStore("demands"),
            "showFooter" => "",
           
            ),
             "columns" => array(
                "project_code" => array(
                    "label" => "Project Code",              
                   "footerText"=>"Total :",
                ),
                "project_title" => array(
                    "label" => "Project Nmae (Implementation Period)",
                     "cssStyle"=>"font-family: cursive",//not working 
                ),
              
            ),
         "cssClass" => array(
        "table" => "table bangla table-hover table-striped table-bordered"
    )
))
?>
    </body>
</html>
KoolReport commented on Apr 3, 2019

Do you mean:

<style>
    body
    {
        font-family:"Arial";
    }
</style>
vudoc commented on Apr 6, 2019

Yes something like that, I would like to show Bengali font, <style>

body

{
    font-family: "SolaimanLipi";
}

</style>

KoolReport commented on Apr 8, 2019

You need to add the @font-face in css to make it work.

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

Laravel