The KoolReport Blog

Announcements, discussions, and more for KoolReport and its extended packages.

Welcome KoolReport 5.0.0

We would like to inform that we have released new version KoolReport 5.0.0 with enhancement and bugfixes. Together with the new core, we also release upgrades for Pivot, Excel, Export, DataGrid, CloudExport and two new packages VisualQuery and ChartTable.

KoolReport 5.0.0 still keeps the same structure as 4.x. That is a good news as the update will be fully backward-compatible. In this version, we added two new processes called Count and TypeAssure. The Count process can help to make count with condition while TypeAssure process will make sure your data's native type correct. The DataStore class has been provided with getScalar() method to get the first value in first row in the store, which is very helpful in many cases.

We have provided two new packages called VisualQuery and ChartTable. Both packages are aiming at creating ad-hoc reports. Ad-hoc report by definition is "a business intelligence process in which dynamic, real-time data reports are created by the user on an as-needed basis". So VisualQuery allows end-user to construct their own query by using GUI while ChartTable helps to visualize queried data in different data visualization charts based on end-user's choice. This is the first version of two new packages so there will be many improvements in near future, and your suggestions, recommendations are very much appreciated.

The following packages offer huge updates with improvement and new features:

  1. DataGrid now supports fast rendering up to 100 000 rows, multi-level row group with grouped values, and row detail expand/collapse setting.
  2. Excel can export tables with multi-level row group with grouped values.
  3. Export allows for fully customized headers and footers. Different pages can have different header/footer programmatically via headerCallback and footerCallback functions.
  4. Pivot has a new process called PivotSQL which uses sql aggregate functions, thus works faster for large sql datasets than the normal Pivot which loops through all data rows.
  5. CloudExport adds another export engine in PhantomJS beside headless Chromium and WkHtmlToPdf. PhantomJS's pdf rendering might not be as beautiful as headless Chromium or as fast as WkHtmlToPdf but it has a special advantage in fully customized headers and footers.

Above are just some highlights of some important release notes, we also have new releases for Input 5.6.0, QueryBuilder 2.5.3, Amazing Theme 1.5.0, BarCode 2.0.0 with more details in the changelogs.

Thank you very much!

P.S: Our team will bring you the beast, KoolReport Dashboard Framework in next month.

<koolreport team

Google Charts is required to update

Recently, Google has updated its Charts library. As a result from this update, your chart may not render properly and could receive error while rendering. We acknowledged the issue and has acted fast to provide the hot fix in new KoolReport 4.7.0. Please upgrade!

In this version, we provided some other updates to make sure everything working great. First, the KoolReport's resource manager is improved to better generate resource folder. Second, KoolPHP Table is enhanced with added average calculation in footer and with the fix of row click event in the header of table.

Together with new core 4.7.0, we released KoolReport Pro 4.7.0 with new package's updates:

  1. CloudExport 2.1.1: Upgrade ChromeHeadlessio core to support multi language and font load.
  2. Cube 3.1.0: Adding finalValue property for custom aggregation
  3. DataGrid 4.0.0: Ability to load plugins
  4. Excel 7.2.0: Fix bugs, more excel chart's options, upgrade core MS PHPSpreadSheet.
  5. Export 4.1.0: Adding default parameters for pdf() method.
  6. Inputs 5.5.0: Upgade core javascript library
  7. QueryBuilder 2.5.1: Able to rebuild query from array data.
  8. Pivot 6.3.0: Adding finalValue property for custom aggregation

Thank you very much!

<3 koolreport team

Coronavirus: How can we help?

This is an unprecedented time in our history. The COVID-19 pandemic is having an impact on the health of our loved ones, the businesses we rely upon, the health of the global economy, and the way we live our daily lives. Although small, we would like to contribute our effort to help.

We are here to help our customers

We stand ready to help you with safe, secure and affordable reporting solution. KoolReport framework is continued to improve with new features and bug fixes to ensure your report application relied on us continue to run well. We are working hard to fulfill our support responsibility to our customers and all KoolReport's users. We continue to get outsourcing projects done even our customers may be late on payments. We truly understand "a friend in need is a friend indeed".

Discount our licenses

In this flat world today, every businesses is connected to each others. Crisis somewhere else reach us in the way I could not think of. Job loss, project halted, late payment, all can happen putting financial burden in our shoulder. That's why we discount 40% for all KoolReport Pro licenses during this hard time. We understand and would like to share the burden with you.

Take care of our employees, who serve you

Supporting our employees during this crisis period is critical to providing you the service you need and expect. We have taken actions as Covid-19 spreads to protect the physical health and financial security while supporting our customers. Our employees are allowed to work remotely. We provided them with tools to work effectively from home. During their transition from workplace to home, you may see some impact of wait time for our support answer. We greatly appreciate your patience and understanding as we work through this together.

Thank you

We would like to say thanks to all for your trust you put in us everyday. We believe that the crisis will be gone soon and we together be back stronger than ever.

<3 koolreport team

10 PHP Libraries That You Should Not Miss

It has been 25 years since the first version of PHP in 1995. Despite of its age, PHP is still one of the most programming languages in the world and be the top choice of many back-end developers. Let look at 10 PHP libraries that you need to know.

Most Used PHP Libraries

1. PHP-ML

https://github.com/php-ai/php-ml

A new way to approach Machine Learning (ML) in PHP, PHP-ML is an interesting library to work with. It provides you an easy way to use API training your bot to do prediction based on your inputs. It contains a series of algorithms to recognize patterns and performs complicated statistics.

PHP Machine Learning

2. Opauth

https://github.com/opauth/opauth

This library allows users to authenticate via their personal account on social networks or other services. Of course, it includes all the big names: Google, Facebook, Twitter, Github, Instagram, LinkedIn.

PHP Authentication

Opauth is supported by many PHP Frameworks, it is easily to be integrated in almost all current PHP applications such as: vanilla (plain) PHP applications, CakePHP, CodeIgniter, FuelPHP, Laravel, PrestaShop, and many more.

3. PHPMailer

https://github.com/PHPMailer/PHPMailer

No PHP library collections is perfect without PHPMailer - an complete email library for PHP. This project is supported by large community and being used in very popular applications such as Wordpress and Drupal. That makes it become first choice for sending email in PHP. It supports SMTP, HTML email and more..

PHPMailer

4. ImageWorkshop

http://phpimageworkshop.com/

ImageWorkshop is open-source PHP library allowing you to work with image layers. With it, you can easily change image size, crop, create thumbnail, adding watermark and more. Here is some example:

PHP Image Library

ImageWorkshop is developed to make your most common work on image in the easiest way. If you need more powerful library, you can look for Imagine library.

5. Carbon

https://github.com/briannesbitt/Carbon

Carbon is a great open source library to deal with datetime with various class and methods. For example:

PHP Datetime library

6. Ubench

https://github.com/devster/ubench

Ubench is a small library to check performance of your PHP code. It measures your code execution time as well as the needed memory. Using Ubench during your application development is a good idea as it can help to analyze, detect and enhance your code quality, ultimately improve the performance of your application.

Ubench

7. Faker

Faker is a PHP library to create fake data. It is very convenient and easy to use when you need an experiment database or sample data for your web application. Let look at some sample code:

PHP Fake Data

Every time you call properties of the object, a new random data will be generated.

8. Omnipay

https://github.com/adrianmacneil/omnipay

Omnipay is a payment library for PHP. It has a clear and coherent API and support various payment gateway. With this library, we only need to work with one API and work with different payment options. Because of using single unified API, we can easily use many gateways at same time or switch between them when needed.

PHP Omni payment

9. PHPGeo

https://github.com/mjaschen/phpgeo

PHPGeo is an simple library that allows us to calculate geographical distance between coordinates with high precision. This library support well those applications working based on geo locations. In order to get the coordinates, you can use location api of HTML5 or Yahoo api.

PHP Geo Library

10. KoolReport's Google Chart

https://github.com/koolreport/core

KoolReport is an good open source PHP library to provide reporting capability for your application. Google Charts is part of KoolReport can bring you good and free php chart solution. It provides more than 20 most common & advanced charts. The code is very simple to use:

ColumnChart::create([
    "dataSource"=>[
        ["category","amount"],
        ["Computer",100],
        ["Laptop",50],
        ["Tablet",80],
        ["Phones",150],    
    ]
]);

You may view more examples

Conclusion

Above are 10 most popular libraries that you can use to power your php application. Hope that our share is useful.

<3 koolreport team

PHP 7.4: Top 5 Advanced Features That You Need To Know

PHP 7.4 has been released in Nov 28th, 2019 with new syntax and significant performance enhancement. Let look at the top 5 cool features of PHP 7.4 that you should know.

PHP 7.4 Top 5 advanced features

Since PHP7, we have seen the incredible changes in PHP from its syntax improvement to its speed and efficiency. Since the emergence of new language like NodeJS, GoLang, there are always rumor whether PHP is going to die but believe me PHP still move forward and be stronger day by day. It is no wonder that for the second year in a row, PHP is among the top 10 most popular programming languages according to StackOverflow Developer Survey 2019. This year, it took the 8th place which is one rank higher than in the previous year.

PHP 7.4 has been released in Nov 28th, 2019 with new syntax and significant performance enhancement. Let look at the most top 5 cool features of PHP 7.4 that you need to know. Let started!

Arrow function

If you are using ES6 in Javascript, probably you have been familiar with arrow function. The arrow function helps to reduce syntax when we write anonymous functions. So now instead of writing this:

function do_double($n)
{
    return $n*$n;
}
$a = [1,2,3];
$b = array_map("do_double",$a);

With PHP 7.4, you can do:

$a = [1,2,3];
$b = array_map(fn($n) => $n*$n, $a);

As a result, your code will look cleaner & neater, allowing you to save much development & debugging time.

Typed properties

This new feature is considered one of the most important features in PHP 7.4. Previously you need to use getter and setter in order to check types of variables. Now you can easily specify type for class's variables:

class SaleReport
{
    protected int $month;
}

Due to declaration types (excluding void and callable), you can use nullable types, int, float, array, string, object, iterable, self, bool, and parent.

If developer try to assign irrelevant value from the type, he or she will get TypeError message.

The same like arrow function, typed properties will reduce work for developer and make code cleaner and shorter.

Preloading

Finally, preloading is supported in PHP, which will help to improve performance. As you may know, each time you page is requested, the code files will need to read and loaded into memory to execute. Preloading, in simple word is process of loading code files into OPcache to execute faster. It will eliminate I/O process which consume time and resource, hence your page will response quickly.

When you use OPcache, the executed files will be first loaded into memory and will be checked for changes for next time. Preloading will let developer specify certain files to be loaded into memory and stay there. It will help to save time for OPcache to check changes in those files, thus, increase the performance.

PHP 7.4 Preloading performance comparison

It is also noteworthy to mention that during preloading, PHP also eliminates needless includes and resolves class dependencies and links with traits, interfaces, and more.

Covariant & Contravariant

At the moment, PHP has mostly invariant parameter types and invariant return types which presents some constraints. With the introduction of covariant (types are ordered from more specific to more generic) returns and contravariant (types are ordered from more generic to more specific) parameters, PHP developers will be able to change the parameter’s type to one of its supertypes. The returned type, in turn, can be easily replaced by its subtype.

Coalescing assign operator

Below are the most common code that you will see in almost all projects:

$country = isset($_GET['country']) ? $_GET['country'] : 'unknown';

With PHP 7.4, now you can do:

$country = $_GET['country'] ?? 'unknown';

or a little complicated, you can do:

$country = $_GET['country'] ?? $_POST['country'] ?? 'unknown';

A spread operator

Another interesting feature in PHP 7.4 is the spread operator in array. Previously, you may need to use array_merge() to complete in complicated way. But no more, you can do this in PHP 7.4.

$parts = ['apple', 'pear'];
$fruits = ['banana', 'orange', ...$parts, 'watermelon'];

As you notice the ..., the array $part will be spread at right place in $fruits array. This is another feature that help developer to produce cleaner code and also save time on debugging.

Conclusion

There are several other updates in PHP 7.4 that we have not covered yet. Above are the features that we think the most important and that we need to know. As you may be aware that we are working on KoolReport, an PHP framework specializing in data report so keeping update with new features of PHP is a must for us. By utilizing new PHP features, we can improve the way data report should be created and ultimately make developer's life easier.

php

KoolReport helps to analyze your data and ultimately turn them into visual reports or dynamic dashboards.

"KoolReport helps me very much in creating data report for my corporate! Keep up your good work!"

Alain Melsens

"The first use of your product. I was impressed by its easiness and powerfulness. This product is a great product and amazing."

Dr. Lew Choy Onn

"Fantastic framework for reporting!"

Greg Schneider
Get KoolReport Now, It's FREE!