DataGrid Export Not Correct

All ApPHP DataGrid script bugs discussion. Questions and requests here.
Please, use a $debug_mode = true; before you say "Why Nothing Works ?!" (solves 90% of all issues)

Moderator: alexandrleonenko

micromuni
Newbie
Newbie
Posts: 2
Joined: Mar 14th, '13, 18:03

DataGrid Export Not Correct

Postby micromuni » Mar 14th, '13, 18:27

I have ApPHP Datagrid Version 7.49 and have an unlimited upgrade license (current version 7.77)

My problem is that the Excel Export feature is working, but not selecting the correct information.

My datagrid display is correct and I am displaying order item details in reverse order (based on the order number).

The sort option is set to the order number => DESC and is displaying the correct information in the Datagrid Display.

However, the Excel Export file is not correct. It does not reflect the current page that I am viewing.

micromuni
Newbie
Newbie
Posts: 2
Joined: Mar 14th, '13, 18:03

Re: DataGrid Export Not Correct

Postby micromuni » Mar 15th, '13, 12:15

I do have debug set to true.

The Datagrid is correct, but the Excel Export is not correct.
The Excel Export includes additional records that are eliminated from the select statement.

## *** set needed options and create a new class instance
$debug_mode = true; /* display SQL statements while processing */
$messaging = true; /* display system messages on a screen */
$dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix);
## *** set encoding and collation (default: utf8/utf8_unicode_ci)
/// $dg_encoding = "utf8";
/// $dg_collation = "utf8_unicode_ci";
/// $dgrid->SetEncoding($dg_encoding, $dg_collation);
## *** set data source with needed options
## *** put a primary key on the first place



## +---------------------------------------------------------------------------+
## | 3. Printing & Exporting Settings: |
## +---------------------------------------------------------------------------+
## *** set printing option: true(default) or false
$printing_option = true;
$dgrid->AllowPrinting($printing_option);
## *** set exporting option: true(default) or false and relative (virtual) path
## *** to export directory (relatively to datagrid.class.php file).
## *** Ex.: "" - if we use current datagrid folder
$exporting_option = true;
$exporting_directory = "admin";
$dgrid->AllowExporting($exporting_option, $exporting_directory);
$exporting_types = array("xls"=>"true","pdf"=>"false", "xml"=>"false");
$dgrid->AllowExportingTypes($exporting_types);

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

Re: DataGrid Export Not Correct

Postby administrator » Mar 17th, '13, 05:59

1. Please show us this issue online - we have to see what exactly is wrong.

2. There is a new syntax for exporting, please look here:
http://www.apphp.net/forum/viewtopic.php?f=33&t=558

3. Remember, that you may eliminate column from exporting with 'show_on_export' => 'false'

dkochan
Senior
Senior
Posts: 30
Joined: Dec 2nd, '09, 16:23

Re: DataGrid Export Not Correct

Postby dkochan » Sep 4th, '13, 18:07

micromuni wrote:The Datagrid is correct, but the Excel Export is not correct.
The Excel Export includes additional records that are eliminated from the select statement.


I have the same problem that I encountered both on version 7.7.7 and 7.9.9.

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

Re: DataGrid Export Not Correct

Postby administrator » Sep 5th, '13, 08:15

To underrated what happens - we have to see this issue online, please send us a link.

dkochan
Senior
Senior
Posts: 30
Joined: Dec 2nd, '09, 16:23

Re: DataGrid Export Not Correct

Postby dkochan » Sep 8th, '13, 14:27

Problem Fixed

The export problem was in using pt and cty parameters, that were missing while exporting.
To save them use following:

## +-- Passing parameters & setting up other DataGrids ------------------------+
## *** set variables that used to get access to the page (like: my_page.php?pt=s&cty=n etc.)
$http_get_vars = array('pt', 'cty');
$dgrid->SetHttpGetVars($http_get_vars);


Return to “ApPHP DataGrid {bugs}”