Welcome, Guest
Username: Password: Remember me

TOPIC: title name in name file of export

title name in name file of export 2 years 7 months ago #74740

  • Lemercier
  • Lemercier's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
I add this in exportresult.php to get the name of survey in the file name of export result
case "doc":
//insert for add title name in the export file .doc
$query="SELECT * FROM {$dbprefix}surveys_languagesettings WHERE surveyls_survey_id=".$surveyid;
$result=db_execute_assoc($query) or safe_die("Couldn't get privacy data<br />$query<br />".$connect->ErrorMsg());
$row=$result->FetchRow();
$row=substr(str_replace(array('*', ':', '/', '\\', '?', ''),array(' '),$row),0,31); // Remove invalid characters
$titrefichier=str_replace("surveyls_title", "", $row);
$titrefichier=str_replace(' ', '_', $titrefichier);

header("Content-Disposition: attachment; filename=results-quest-".$surveyid."-".$titrefichier.".doc");
// end
for .xls same above just change :
$workbook->send('results-quest-'.$surveyid.'-'.$titrefichier.'.xls');

//
if that can help somebody

I look to find the solution for adding the text result inside the statistics
results instead of clicking on the button
If anybody has already the solution, thanks for your help
\mireille
The administrator has disabled public write access.

Re: title name in name file of export 2 years 7 months ago #74940

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
Thanks for your feedback. Please open a ticket at our bugtracker, section user patches, and add your patch there.

A short question: Why do you only deal with the first 31 characters at
$row=substr(str_replace(array('*', ':', '/', '\\', '?', ''),array(' '),$row),0,31);
?

If I remember correclty, a feature to add text comments at statistics will be available at Limesurvey 2.0.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.104 seconds
Donation Image