Grid view PDF template error

Martin

New member
Dear Eugenio,

I am working on my first dadabik app and so far it’s really great for me with very little programming background.

But now I am trying to make a pdf-template for the grid view but can’t make it working.
As in the manual, I’ve set the $add_pdf_page_for_each_record = 0 and have created the three html-files.
The html is just copy&paste from the manual with just changing the dadabik field names.

But I only get the error message “error template heading” if I am trying to make a pdf from the grid view. Strange thing is that the template is working for the detail view.

Content header:
[pre]

<html lang="en">
<head>
<meta charset="utf-8" />
</head>

<body>

<h1>Ergebnisliste</h1>

<table>
<thead>
<tr><th>Name</th><th>Gesamtergebnis</th></tr>
</thead>
<tbody>

[/pre]

Content template
[pre]

<tr><td>dadabik_field id_schuetzen dadabik_field</td></tr><tr><td>dadabik_field gesamt_ergebnisse dadabik_field</td></tr>

[/pre]
Content footer

[pre]

</tbody>
</table>
</body>
</html>

[/pre]

Thanks for your help!
BR
Martin

My about data:

[pre]
You are using DaDaBIK version 10.3-Manarola enterprise, installed on 08.09.2020 (installation code: 159035f577cb9ad325), the latest version of DaDaBIK is 10.3-Manarola released on 26.08.2020

You are runnning the last release of DaDaBIK

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enteprise to Platinum) please contact us.

System info

PHP Version: 7.2.29

mysql version: 5.5.5-10.3.21-MariaDB

Web server: nginx/1.16.1

Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15

URL installation: http://192.168.178.23/data/
[/pre]
 

TechSupport

New member
Hello,

I have the exact same problem. The three templates produce a PDF in DETAIL view, but not in GRID view returning a new browser window with "Error template heading".

DaDaBIK version 10.1-Manarola platinum
PHP Version: 7.2.29
mysql version: 5.5.5-10.3.21-MariaDB
Web server: Apache/2.4.43 (Unix)
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0

Regards, Tech
 

eugenio

Administrator
Staff member
Hello,
double check if second template (that's the one producing an error) starts exactly with



(no spaces before, no new line ...)

What are the names of the three files?

Best,
 

Martin

New member
Hi,

the names of the files are:
test_header.html
test.html
test_footer.html

I've double-checked all three files, is the first thing in all of them, no spaces, no line before.

BR
Martin
 

eugenio

Administrator
Staff member
Hello,
everything seems correct, I haven't seen this behaviour before; if you can install a toy application (just one table with a few records) having the same problem somewhere and provide via email the info to access it I can have a look.

Best,
 

Martin

New member
Sorry for the late reply.

I have the application currently running on my local NAS and no server/webspace available at the moment.
I'll come back to you as soon as I have anything running online in the neat future.

BR
Martin
 

Martin

New member
I've played a bit more with this issue and found out, that the pdf generation is working just fine if I have no footer file!

I've just the files test.html and test_header.html and it's woking. As soon as I add the test_footer.html I get the Error as described above.
For your info, I have not put the closing tags in the main file. I just seems to work without them.

Maybe this helps also for you @Tech as a workaround
 

eugenio

Administrator
Staff member
Hello,
it should work also with the footer file.
What do you mean with closing tags?

Best,
 

Martin

New member
I know that ist should work with the footer file, but it ist not! It only works if I remove the footer file.

With closing tags I mean </tbody> </table> </body> </html>
Without the footer file these are not present in the template composition.
 

eugenio

Administrator
Staff member
Hello,
there is actually a bug related to the check DaDaBIK does on the string:



in the footer file. The bug only arises if the template is HTML.

Temporary workaround: rename all your template as .php (without changing the content).

Best,
 
Top