Hi!
The Problem: I'm working on implementing the excel export package. I can get my PHP view to display my reports, but when I hit the export button on the front end, the excel file that's downloaded is un-openable. I get no error codes or anything.
The Project: I'm reporting on rooms in a building from a SQL datasource. I've got my code set up to choose which room you want data on, then radiolist select if a summary view or a detailed view of the room should be returned.
Essentially, I'm dealing with three datastores. One for the room dropdown select list. And two for the two different kinds of report views.
I suspect that the excel export package can't tell which datasource I'm trying to export.
Is that the case?
How do I tell exportexcel which datastore to use?
My view code for the export button is below.
<div class="text-center">
<form method="post" action="Room_excel_export.php">
<button class="btn btn-primary">Export to Excel</button>
</form>
</div>
My export code to Room_excel_export.php is below.
<?php
require_once "Room.php";
$room = new Room;
$room->run()->exportToExcel('Room.view')->toBrowser("Room_view.xlsx");
Environment: Ubuntu 16.04 Apache server