Export prints headers but no data

Talk about Printing & Exporting Settings

Moderators: ne_moj, zewa

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Export prints headers but no data

Postby administrator » Jun 21st, '12, 20:11

So do you mean if exporting links we have a broken parameter values?
Can you please check do we have a wrong link or do we receive wrong link parameters after the click was done.

This will help us to understand what exactly happens.
BTW, doe this issue happens with other datagard pages or just with this one?

AndyL
Junior
Junior
Posts: 14
Joined: May 18th, '10, 12:41

Re: Export prints headers but no data

Postby AndyL » Jun 21st, '12, 20:37

I'm at home at the moment, but I'll give you a quick reply until I get back to work.

The page I am looking at is called from a php file like this:

header("Location: ./Report.php?ts=".$ts."&te=".$te);
This page has session_start() in it.

In Report.php, these two parameters ($_GET['ts'] and $_GET['te']) are used in an SQL statement. This statement is used to create the grid.
session _start() is also in this file.

When the excel icon is clicked, and Report.php is run again, the two parameters ($_GET['ts'] and $_GET['te']) are now null.
For the time being, I have got around this using

if (isset($_GET['ts'])) {
$_SESSION['timestart']=$_GET['ts'];
}
if (isset($_GET['te'])) {
$_SESSION['timeend']=$_GET['te'];
}

and then used the session variables later on in the file. So if they were not set, effectively they would use the values from the last time the file was run.

Is that clear?

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Export prints headers but no data

Postby administrator » Jun 24th, '12, 07:28


AndyL
Junior
Junior
Posts: 14
Joined: May 18th, '10, 12:41

Re: Export prints headers but no data

Postby AndyL » Jun 24th, '12, 09:27

Ah OK thank you for that. There are lots of features of the grid that are sometimes hard to find.

I actually implemented an export of my own not using the grid but using phpExcel. It has a lot of features such as formatting, images, being able to specify a filename etc etc. You should consider using it for the grid.

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Export prints headers but no data

Postby administrator » Jun 25th, '12, 07:00

Thanks, but it's to hard to use library of 19MB with the project of 1.5MB.
Anyway, other members may find it useful for their project.


Return to “Settings: Printing & Exporting”