View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
05039Bug reportsOtherpublic2011-04-11 11:30
Reporterdionet Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Fixed in Version1.91RC6 
Summary05039: Malformed PDF and XLS when exporting statistics
Description

When you export a statistics report as a PDF or XLS file, the resulting files are broken.

Although I didn't have any problem opening these files, there may be situations they don't work properly.

Steps To Reproduce

Open Administration Panel;
Select a survey;
Click "Responses & statistics";
Click "Get statistics from these responses";
Export to Excel or PDF.

Open the file with an hex or text editor and look for html code at the bottom.

TagsNo tags attached.
Attached Files
statisticsfix.diff (559 bytes)   
Index: admin/statistics.php
===================================================================
--- admin/statistics.php	(revision 9890)
+++ admin/statistics.php	(working copy)
@@ -1621,9 +1621,11 @@
             break;
         case 'pdf':
             generate_statistics($surveyid,$summary,$summary,$usegraph,$outputType,'I',$statlang);
+            exit;
             break;
         case 'xls':
             generate_statistics($surveyid,$summary,$summary,$usegraph,$outputType,'DD',$statlang);
+            exit;
             break;
         default:
 
statisticsfix.diff (559 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)9890
I will donate to the project if issue is resolved
Browser
Database type & version
Server OS (if known)
Webserver software & version (if known)
PHP Version

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2011-03-21 00:40

updater   ~14484

Can you explain "the files are broken" in more detail? What's wrong if you can open these files?

dionet

dionet

2011-03-21 01:25

reporter   ~14492

When you export a PDF or an Excel file, the script doesn't end after the file is generated. That means it also outputs the export statistics page html. So the resulting files have unnecessary html in the bottom. The files can still be opened, but they aren't valid. I tried to validate an exported PDF before applying the patch but it returned this warning "There is data after the EOF marker." (at the 3-Heights PDF Validator Online Tool). Applying this patch fixes the problem and results in smaller files.

Mazi

Mazi

2011-03-22 16:23

updater   ~14509

Carsten, can you please have a look at this issue and the attached patch...

c_schmitz

c_schmitz

2011-03-23 23:11

administrator   ~14529

Thank you!

c_schmitz

c_schmitz

2011-04-11 11:30

administrator   ~14763

1.91RC6 released.

Issue History

Date Modified Username Field Change
2011-03-17 18:40 dionet New Issue
2011-03-17 18:40 dionet File Added: statisticsfix.diff
2011-03-21 00:40 Mazi Note Added: 14484
2011-03-21 00:40 Mazi Assigned To => Mazi
2011-03-21 00:40 Mazi Status new => feedback
2011-03-21 01:25 dionet Note Added: 14492
2011-03-21 01:25 dionet Status feedback => assigned
2011-03-22 16:22 Mazi Assigned To Mazi => c_schmitz
2011-03-22 16:23 Mazi Note Added: 14509
2011-03-23 23:11 c_schmitz Note Added: 14529
2011-03-23 23:11 c_schmitz Status assigned => resolved
2011-03-23 23:11 c_schmitz Fixed in Version => 1.91RC6
2011-03-23 23:11 c_schmitz Resolution open => fixed
2011-03-23 23:11 c_schmitz Project @2@ => Bug reports
2011-04-11 11:30 c_schmitz Note Added: 14763
2011-04-11 11:30 c_schmitz Status resolved => closed
2021-03-08 20:08 c_schmitz Category Statistics => (No Category)