Export answers into a custom designed PDF or similar?

More
3 years 2 months ago #123799 by DOwen
DOwen created the topic: Export answers into a custom designed PDF or similar?
Hi all,


We've been building internal company forms with LS and its been a great success so far.

We now want to build a new website that contains forms with complex 'if this then that' questions that are filled in while an agent takes a call. We want the agent to then be presented with a PDF file that contains all the answer data pre populated into a well designed PDF. It would need to be a design that matches our current branding as it would be visible to clients. We currently only use PDF files that are designed within InDesign and filled in using interaction, however we want the forms to be a little more advanced and intuitive.

Could we achieve this somehow with LimeSurvey? If not, would anyone please be able to advise our best option?


Thanks!

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #123806 by holch
holch replied the topic: Export answers into a custom designed PDF or similar?
Of course you can collect the information with Limesurvey. However, the design of the PDF is a totally different aspect. While Limesurvey offers a certain PDF export option, it is far from being beautiful and it is not a focus of Limesurvey.

However, as Limesurvey is open source and you have access to the database, as it is running on your own server, you can easily access the answers / data collected with other applications and insert the data into an own tool, that is generating your PDF reports. I have no idea what is available out there and what could satisfy your needs for this. What I can think of is that you could create a report page at the end of your LS survey. You could create a nice template that matches your layout requirements (but as it is HTML/CSS it might not look as nice as Indesign documents) and you could then find a routine that "prints" this HTML page as PDF file.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #123808 by DOwen
DOwen replied the topic: Export answers into a custom designed PDF or similar?
Hi there and thank you for your response!

It sounds like creating a HTML/CSS version of the PDF, which could then be converted to a PDF somehow (Or just manually saved a PDF by the agent) is the best option. However, I have no idea where to start here. I would guess that there's quite a bit of Javascript and/or SQL involved here of which I'm not proficient.

Are you able to advise where I can start please?

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #123809 by LouisGac
LouisGac replied the topic: Export answers into a custom designed PDF or similar?
in global settings, you have an option "Participants may print answers".
You could try to hack this feature, changing its rendering.

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #123811 by holch
holch replied the topic: Export answers into a custom designed PDF or similar?
Actually, if you use the Expression Manager and text display questions on the last page of your survey, you don't really need to use any Javascript or SQL. You can then create a page that shows the results of the survey, before the final submission of the survey.

You could then let them print it via Acrobat (or any PDF print driver).

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #123825 by DOwen
DOwen replied the topic: Export answers into a custom designed PDF or similar?
This potentially sounds like a good plan! I've not managed to get into the Expression Manager just yet. Perhaps I should study the manual.

In this scenario, if they had the option to print, what would be the best way to achieve a precisely/well designed PDF?

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #123829 by steve_81
steve_81 replied the topic: Export answers into a custom designed PDF or similar?
Hi,

I recently designed an end-page for the participant, so he can see an individual evaluation of his answers.
I used the Expression Manager to get the data and displayed it in this case as scales.



You are completly free with the design, just using CSS/HTML.

Printing was one requirement, so I tried printing this with several browsers just clicking file -> print. After a few adjustments, the result satisfied me.

Greets
Stefan
Attachments:
Last Edit: 3 years 1 month ago by steve_81.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #123841 by holch
holch replied the topic: Export answers into a custom designed PDF or similar?
Hey Stefan, this is a great example of what can be done. I guess it took you a while to get there.

How did you implement the styles? In the template itself? Or inline only on the results page?

How did you create the Benchmark? This couldn't have been done with only Expression Manager, because you can't access other results.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #123842 by steve_81
steve_81 replied the topic: Export answers into a custom designed PDF or similar?
Yes, I defined the styles directly in my template.css

You are absolutly right. At this moment, the Benchmark is a fixed one depending on N=1.600 from a previous survey, but I've already written a database-request (jquery with php), which will give me the Benchmark on the fly, if we have enough participants with this survey.

Greets
Stefan

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #123844 by holch
holch replied the topic: Export answers into a custom designed PDF or similar?
Sounds pretty nice. Exactly what I had envisioned for DOwen's problem, but without any practical experience. Seeing a live example is really interesting and proves that it is doable.

And in my opinion it looks pretty good. I don't know the standard DOwen is looking for, but for me this looks pretty great.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #123848 by DOwen
DOwen replied the topic: Export answers into a custom designed PDF or similar?
Oh awesome, that looks really good Stefan!

This will work great for us too, would be great to see more of the background work on this?

I've just been hit with another issue on this project. We are concerned that we may need to go back and edit the answers on the survey/form if a mistake was made or if something needs to be added. Of course we can edit the answers from within the LS Admin, however since the form has already been submitted, we no longer have the completed screen to print off a summary of answers (and/or save a PDF). Is there a way around this?


*Sorry only just realised I've probably posted this in the wrong section!*
Last Edit: 3 years 1 month ago by DOwen.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #123852 by steve_81
steve_81 replied the topic: Export answers into a custom designed PDF or similar?
The top is the common design of the "welcome id" and the "survey-name class":
<br />
<div id="welcome">
	<span class="survey-name">Ergebnisse der Auswertung</span></div>
<br />

The rest is a wild combination of tables and divs, inline styles and adjustments. I'm not very proud of the source code it is a mess.

An improvement screenshot:


The first aspect under the first picture (beginning with "Anteil im Büro") looks like this:
<table style="border:0px; width: 100%">
									<tbody>
										<tr style="background: #E0E0E0">
											<td align="left" colspan="2" width="100%">
												<b>Anteil im Büro (pro Monat):</b></td>
										</tr>
										<tr>
											<td style="padding: 0px; width: 28px;">
												<img src="/waytoimages/office" width="100%" /></td>
											<td>
												<div class="percent-own" id="pBuero">
													Eigener Wert:
													<div id="ppBuero" style="float:right;">
														 </div>
													<br />
													<img class="Dreieck" src="/waytoimages/triangledown" /></div> <!-- This is the div which width is given by the Expression Manager, in this case I use javascript, because I have to convert the value of an answer to fit in the scale-->
												<div class="percent-pre2">
													Sehr gering</div>
												<div class="percent-bar2" id="barBuero">
													<div class="percent-range2" id="Buero25" style="text-align:left;width:24.5%;border-radius: 1em 0em 0em 1em;">
														0%</div>
													<div class="percent-range2" id="Buero50" style="width:24.5%;">
														 </div>
													<div class="percent-range2" id="Buero75" style="width:24.5%;">
														 </div>
													<div class="percent-range2" id="Buero100" style="width:24.5%; border-radius: 0em 1em 1em 0em;">
														100%</div>
												</div>
												<div class="percent-post2">
													Sehr hoch</div>
												<div class="percent-mean" id="mBuero" style="width:63.864%;">
													<img class="Dreieck" src="/waytoimages/triangleup" /><br />
													Benchmark:69.8%
													<div id="mmBuero" style="float:right;">
														 </div>
												</div>
											</td>
										</tr>
									</tbody>
								</table>

The mentioned javascript part width the value from the survey:
document.getElementById("pBuero").style.width = "{(ProzentBuero.NAOK*0.7)+15}%"; // ProzentBuero is a hidden equation question which calculates a percentage of beeing in the office

And some styles:
.percent-pre2 {
    color: #888;
    float: left;
    text-align: right;
    height: 2em;
    position: relative;
    width: 15%;
    right: 0.6em;
    line-height: 2em;
    vertical-align: middle;
    clear: left;
}
 
.percent-bar2 {
    -moz-border-top-colors: none;
    -moz-border-right-colors: none;
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    border-image: none;
    border-width: 1px 0px;
    height: 2em;
    position: relative;
    font-size: 0.9em;
    float: left;
    width: 70%;
}

It's a completly own designed page, next time I would search for some plugins to display the graphs. There are some good ones out there.
Attachments:
Last Edit: 3 years 1 month ago by steve_81.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #123860 by holch
holch replied the topic: Export answers into a custom designed PDF or similar?
If you need to go back while the form isn't finished, you could always go back in the survey. Now if the changes should be made when the survey is already submitted, I don't see how you can gain access to this simple way of solving your problem.

In this case you probably will have to custom code some PHP script that can be called based on the ID of the response. This could be called even after the survey has been submitted. But this would be of course a lot more custom coding with PHP and MySQL involved.

Not as simple as the EM approach.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #123875 by DOwen
DOwen replied the topic: Export answers into a custom designed PDF or similar?
Hmmm. It's a shame there's no way of accessing the survey again after submission.

Is there absolutely no other solution apart from involving a lot of custom PHP and MySQL?

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #123878 by DOwen
DOwen replied the topic: Export answers into a custom designed PDF or similar?
I'm thinking that an alternative option for us would be to allow the agent to access the database of answers within LS after the survey is submitted to edit the answers, then export the PDF from there.

However, I have no idea how to customise the PDF design that LS produces on this screen. I guess there's no CSS file to edit anywhere, and I've heard mPDF being mentioned. Would mPDF work for the export to PDF option on the Responses page? I'm not familiar with mPDF and have looked at the website and forums but cannot figure out how its used...

Also, the Export to PDF feature will print all questions unless the agent manually selects what they want. Which would be inefficient as there will be a LOT of questions to go through, including hidden questions with no indication if they have been answered. On second thoughts, I don't think this option will work at all.

Another thought. Can mPDF be effective for use when exporting the results to PDF from the Responses screen, as well as the export to PDF (print) feature at the end of the survey? If so, will I need to implement this once or twice? I think I need a guide on how to use mPDF with LimeSurvey!
Last Edit: 3 years 1 month ago by DOwen.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!