Issue With Templated Reports

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Issue With Templated Reports

Post by htuser »

Dear Cspro Developer Team,
I'm trying, months later to implement a basic report. The first issue that i see, when i transfer the output html to other users, they can't open the report since it require: <script type="application/javascript" src="file:///C:/Program%20Files%20(x86)/CSPro%207.2/Reports/mustache.min.js"></script>

I think that a solution to this would be to output, optionally, in pdf. There's a lot of open source javascript project
a) https://github.com/MrRio/jsPDF
b) https://github.com/eKoopmans/html2pdf
able to output pdf from html file. So, i hope this will not be so difficult and time consuming to you.

Another, why not in setreportdata, data_source do not include item?
The data_source must be one of the following:
data_source Description
value A string expression containing some text.
record_name The contents of a record, including multiply occurring records. In a data entry application, only information up to the number of entered occurrences will be stored.
list_name The contents of a list.
array_name The contents of a one- or multiple-dimensional array.
sqlquery The result set of a query executed by the sqlquery function. Do not specify that function's optional result_set argument, as the result set is stored in memory when called by setreportdata.

Best Regards,
G.VOLNY, a CSProuser from Haiti, since 2004
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Issue With Templated Reports

Post by josh »

The simplest way to generate PDF is just to save the page as PDF from the browser. Most browsers support it. We will consider integrating PDF generation but it isn't going to be a high priority as the majority of users just want to view the reports on the tablet and not to save the them. You could also install https://wkhtmltopdf.org/ on your PC and call it from a batch to convert the html to PDF.

setreportdata doesn't accept item as a source since you can already any simple string value, including from an item. So you can already do setreportdata("name", NAME) or setreportdata("age", maketext("%d", AGE)).
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Issue With Templated Reports

Post by htuser »

Hi Josh,
Thank you for considering to output report in PDF. As you know, it's very important to CsproUsers to output questionnaire in a paper like printable format in a easily readable way. You help me years ago with it. Templated Reports should simplify this. However, with this issue (require dependencies..), it's not ready. So, output them, optionally , natively in PDF is very important. It's very time consuming to open each HTML and save them in PDF. More, HTML doesn't easily kept formatting options.

About items, in setreportdata, you're right. All are correct with my basic example.
Best Regards,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply