Hi there,
Im looking for Javascript to generate pdf report at the end of survey. This report contains all responses including graph, result and recommendation which created using Javascript too.
Just to confirm, do you want a pdf to be downloaded for each participant every time they complete the survey?
Aanurag_QC yes, correct.
As far as I can recall Qualtrics does not have the option to download a pdf at the end of the survey. You have the option to view the response but not download it. For the Graphs, you can either use Report or Dashboard to download such data and provide it to the participant.
imalik
2 ways to do this if you haven't already explored.
- When you enable show response summary within the customize options of end of survey it enables a button to download PDF.
- You can create a button that does the job if you want a specific div element to be printed. You can create a custom end of survey via using table include it in an id and everytime respondent clicks print that would be printed. I have kept it on button click you can do it on page load as well.
Hope it helps!
Deepak Hi, thanks it works for the second option. However, the result generated only for the current page (where the download button located). Any other way to generate the whole response from the first page (beginning) to last page?
imalik
Can you provide a visual of what your configuration is?
Deepak
So this survey consists of several sections and each sections has several questions. Every time the next button is clicked, it will run the script as follows:
//(Section 1)
Qualtrics.SurveyEngine.addOnPageSubmit(function (type) {
let surveyHTML = document.createElement("div");
if (type == "next") {
let viewHTML = document.getElementById("Questions");
surveyHTML.append(viewHTML);
Qualtrics.SurveyEngine.setEmbeddedData( "Survey_HTML", surveyHTML);
}
});
//(Section 2)
Qualtrics.SurveyEngine.addOnPageSubmit(function (type) {
let currentViewHTML = Qualtrics.SurveyEngine.getEmbeddedData( "Survey_HTML"); //got empty object
let viewHTML = document.getElementById("Questions");
if (type == "next") {
currentViewHTML.append(viewHTML); //got error
Qualtrics.SurveyEngine.setEmbeddedData( "Survey_HTML", currentViewHTML );
}
});
And in the end of the survey (not tested yet):
imalik
If you just show the entire response summary on end of survey and then print it will print the entire response.
Or you will have to pipe everything in one hidden question element and print that specific question
Hope it helps
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.