KoolReport's Forum

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

KoolReport Dashboard Widget Position Problem On PDF Export #3219

Open afieq opened this topic on on Dec 28, 2023 - 9 comments

afieq commented on Dec 28, 2023

Hi,

I encounter a problem where i print PDF of my dashboard the Widget arrangement position is not the same as my Dashboard. The Widget is now out of position when export it into PDF format. How do i arrange the Widget same as dashboard for my PDF export?

Below is my dashboard.

Below is the PDF export.

Thanks in advance

Regards, Afieq

afieq commented on Dec 31, 2023

Hi,

Any help i can get for this problem?

Thanks in advance.

Regards, Afieq

afieq commented on Jan 2

Hi,

Any help i can get for this problem? Thanks in advance.

Regards, Afieq

KoolReport commented on Jan 5

I am consulting the dev.team for solution

afieq commented on Jan 11

Hi KoolReport,

Any update from dev.team?

Regards, Afieq

afieq commented on Jan 15

Hi KoolReport,

Any update?

Regards, Afieq

John commented on Jan 15

You may use a custom view file and fix this. Look what i do in this topic and search a little more in the forum > https://www.koolreport.com/forum/topics/3225#p17461

afieq commented on Jan 18

Hi John,

I have look at you topic and still not solving on the problem i'm facing.

Regards, Afieq

John commented on Jan 18

You should do something like this and style your pdf however you want (table, div etc):

	<div style="width: 50%;float:left;">
		<?php 
		$myWidgetvar = $dashboard->widget('myWidget');
		echo $myWidgetvar->exportedView();
		?>
	</div>
Sebastian Morales commented on Jan 19

I think what John suggested is workable for your case. You can set an export view file for your board like this:

class MyBoard extends Dashboard
{
    protected function onCreated()
    {
        $this
            ->pdfExportable([
                'viewFile' => './export_views/MyBoardPDF',
            ]);
    } 

Then in your export view file "MyBoardPDF.view.php" you can custom widget's positions anywhere you like, even with a different grid system than the board's web view.

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

Export