Author Topic: Problem with ExportData and printing charts  (Read 5068 times)

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Problem with ExportData and printing charts
« on: July 19, 2016, 11:30:40 am »
When I tried to export data I encountered this problem:
POST http://localhost/Paramquery/samples/exportData 405 (Method Not Allowed)
I used IIS and created a virtual directory pointing to my Paramquery directory

Also the inline charts are not printed and also not all the headers are present in the print.

The jsfiddle is at http://jsfiddle.net/teejt/013y54hp/23/

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #1 on: July 19, 2016, 03:27:24 pm »
I realize if I put the title in colModel - then it appears in the header when grid is printed out. It means the print method only prints the title property in the header of grid.
It seems that the SVG chart object was not drawn in the print page.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5887
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #2 on: July 19, 2016, 03:33:24 pm »
1. You need to configure your IIS or web.config to allow POST data.

2. Post rendering ( modification of DOM nodes in column.postRender() callback or refresh event ) is not included in print or exported data currently, might be added in upcoming versions.
« Last Edit: July 19, 2016, 03:35:25 pm by paramquery »

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #3 on: July 20, 2016, 07:42:55 am »
Thank you for your prompt reply. Really appreciate your help.
May I ask when will the post-rendering be available for Print.
I need to print some charts in the grid.
I have followed the steps to enable post requests for static html uisng IIS7 as in:
http://sysadmin.circularvale.com/server-config/enabling-post-requests-to-static-eg-html-pages-using-iis-7/
I still get the same error:
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)

Is there something else I need to do to enable POST request in the html?

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #4 on: July 20, 2016, 08:18:08 am »
I have also tried to install on my own website at

I have created a directory for exportdata
What are the settings I must do?

However I get this error:
 No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access. The response had HTTP status code 404.


Edit: urls removed by moderator.
« Last Edit: July 22, 2016, 10:33:20 am by paramquery »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5887
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #5 on: July 20, 2016, 10:34:33 am »
1. Right now work is going on some high priority items. I've added this ( printing of post rendering ) to the queue of upcoming features, thanks for your feedback, guesstimate for arrival is 2- 3 months.

2. Export of data of grid doesn't require any extra steps besides having ability in your server script / service to handle POST requests.

For troubleshooting I suggest to create a simple HTML form and try to send POST requests to the same remote scripts. As soon as you make it work, export of data from grid would work too.
« Last Edit: July 20, 2016, 10:36:28 am by paramquery »

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #6 on: July 20, 2016, 01:24:56 pm »
I have tried but to no avail.
When I deleted the exportData folder in my samples directory - it gives this message:
Failed to load resource: the server responded with a status of 404 (Not Found) - http://localhost/Paramquery/samples/exportData

It is this line setting that I don't understand:
url: "/Paramquery/samples/exportData",

Does this have to be a valid url?
I believe the exportData is a function or method in Javascript inside the html file but what is the url to look for the function?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5887
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #7 on: July 20, 2016, 10:26:15 pm »
I hope you have read the API documentation for exportData() method. http://paramquery.com/pro/api#method-exportData

url: "/Paramquery/samples/exportData" is the relative url to remote server script in ASP.NET(MVC) and the script is provided in the demo under ASP.NET(MVC), PHP and Java tabs. url can also be an absolute url.

Example: http://paramquery.com/pro/demos/export

If your remote script is in exportData.aspx file then url should be "/Paramquery/samples/exportData.aspx"


Anyway if you find it difficult to handle POST requests on the server, please check this demo to export the data locally.

http://paramquery.com/pro/demos/export_local
« Last Edit: July 20, 2016, 10:35:40 pm by paramquery »

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #8 on: July 21, 2016, 07:08:59 am »
I have tried to convert the html to aspx and used the instructions you gave me i.e.
If your remote script is in exportData.aspx file then url should be "/Paramquery/samples/exportData.aspx"
However I get this error:
jquery.min.js:2 GET http://localhost/Paramquery/samples/Export.aspx?pq_filename=%3C!DOCTYPE%20html%3E%3Chtml%20lang= 500 (Internal Server Error)

However using your sample to export data locally - http://paramquery.com/pro/demos/export_local
I got it to work! Thanks and the clients should be using the browsers listed.

Thank you very much!

TeeJT

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Problem with ExportData and printing charts
« Reply #9 on: July 21, 2016, 07:21:30 am »
The grid with chart in the cells, when exported as xlsx - the cells are not rendered with chart but are filled with
<div class='chart'>Wait..</div>

I suppose the svg output from graphael can somehow be obtained and compressed into the xlsx and the cell points to the location of the svg file - it will be a way to save the grid with charts. It does sound like a lot of work though.