KoolReport's Forum

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

How to call different view file in render with single class #410

Open mike opened this topic on on Aug 10, 2018 - 8 comments

mike commented on Aug 10, 2018

Hi I am trying to view diff view file with same class name ...

       <div class="one ">

$render1 = new EventTotalReport(array(
												"data_e"=>$event_details_report,
												"totalReport"=>$total_ReportData,
												"totalOrderReport"=>$total_orderData,
												"data_byname"=>$data_byName,
												"data_total"=>$data_byTotal,
														));
					        $render1-> run()->render();

      </div>


    <div class="two">

	 $render1-> run()->render("Event_usd_sales");

    </div>

   <div class="three">

	 $render1-> run()->render("Event_cad_sales");

    </div>

only div one is able to display ... remaining not ...

KoolReport commented on Aug 10, 2018

You should only run() the report once. You may render many:

$report->run();
$report->render("ReportView1");
$report->render("ReportView2");
mike commented on Aug 10, 2018

I tried same ....

$report->render(); ////here I get data from class

$report->render("ReportView2"); //// here no data from class //// it display no records found

$report->render("ReportView1"); //// here no data from class //// it display no records found

mike commented on Aug 10, 2018

Hi , the issue has solved......

but in second and third view file chart is not in full width....

mike commented on Aug 11, 2018

Any update....

when i render it second time and more .... its unable to display on tab or mobiles.....

KoolReport commented on Aug 11, 2018

I think I might know what happens, let me abit of time, I will guide you how to do it correctly.

KoolReport commented on Aug 11, 2018

Coud you please try different approach which use the innerView() function of koolreport. This function allows another view to be rendered inside a main view. So let say MyReport has a view MyReport.view.php as the main view. Inside that view, you can use the innerView() to call another "View2.view.php".

So what you do now is to make only one render:

$report = new EventTotalReport;
$report->run()->render();

Now inside the EventTotalReport.view.php you can do:

<?php
    $this->innerView("View1"); // Given that you have smaller view "View1.view.php" in the same folder.
?>

Let try it.

mike commented on Aug 13, 2018

Thats ok ....but inside the EventTotalReport.view.php I don't need another view file ....by this approach we can do in single view file ....

I need data from same class file but view location is different ......

mike commented on Aug 13, 2018

I think here some js issue ....pls guide me how to add "defer" in script tag .....

<script type='text/javascript' src='https://192.168.1.100/newlive/assets/17390824960/js/bootstrap.min.js' defer></script> <script type='text/javascript' src='https://192.168.1.100/newlive/assets/17390824960/js/jquery.min.js' defer></script>

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