EasyUI Forum
May 17, 2024, 02:45:39 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: PivoteGrid - Export data  (Read 6385 times)
juancitop
Newbie
*
Posts: 22


View Profile Email
« on: March 05, 2020, 07:08:25 AM »

Is posible export to excel ?

Thanks in advance.
Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #1 on: February 04, 2021, 04:04:38 AM »

Is there any help for this ??

I need it too ;-)

Regards
Jesper
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #2 on: February 05, 2021, 01:40:06 AM »

The 'toExcel' method is available. Please download a newer version from https://www.jeasyui.com/extension/pivotgrid.php
Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #3 on: February 05, 2021, 03:08:47 AM »

Hi Jarry.

Thanks.

But there is an error. Excel sheet contains double rows

See attachment.

And how to only have selected rows to excel ?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #4 on: February 09, 2021, 06:50:22 PM »

Please download a newer version from https://www.jeasyui.com/extension/pivotgrid.php
To export the selected rows, please try this code.
Code:
var rows = $('#pg').pivotgrid('getSelections')
$('#pg').pivotgrid('toExcel', {
  filename: 'test.xls',
  rows: rows
})
Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #5 on: February 10, 2021, 02:52:20 AM »

Hi Jarry

Using the latest version 1.0.2. Checked that it not is using file from cache.

Same error. exports double rows

Selected rows also exports all rows, and double.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #6 on: February 10, 2021, 08:17:52 AM »

Please make sure the 'rows' passed to the 'toExcel' method is not empty.
Code:
$('#pg').pivotgrid('toExcel', {
  filename: 'test.xls',
  rows: rows
})
Logged
juancitop
Newbie
*
Posts: 22


View Profile Email
« Reply #7 on: February 10, 2021, 10:27:59 AM »

Hi Jarry, thanks for adding export method.
I'm having the same problem, the duplicated values when export, but the same occurs at Totals...

I´m exporting all rows:

Code:
$('#pg').pivotgrid('toExcel', {
filename: 'pivotgrid.xls',
worksheet: 'Worksheet',
caption: 'Caption'
});
« Last Edit: February 10, 2021, 10:29:45 AM by juancitop » Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #8 on: February 11, 2021, 05:53:03 PM »

This issue has been fixed. Please download a newer version from https://www.jeasyui.com/extension/pivotgrid.php
Logged
juancitop
Newbie
*
Posts: 22


View Profile Email
« Reply #9 on: February 12, 2021, 07:50:28 AM »

Thanks jarry !!!

There is a problem that persist, please see attached img.

Logged
jega
Full Member
***
Posts: 190


View Profile
« Reply #10 on: February 14, 2021, 02:33:51 AM »

Hi Jarry.

Now it works. No double rows

Using this var rows = $('#pg').pivotgrid('getSelections') always take all rows

Changed it to getCheckedNodes and it exports only selected rows. If no rows selected it export all

Maybe you can answer this. Filename = pg.xls

When open exported file in excel, it says

"the file format and file extension of pg.xls do not match. File can be corrupted or......."

I can just push the YES button to open it, and everything is fine


Jesper
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!