pdf export custom template

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
airdriver
User
Posts: 9

pdf export custom template

Post by airdriver »

I made my first custom template, it works fine. But when I am going to export the report to pdf, I get an error.

Route 'api/export/pdf/reportname' not found.

pdf export in standard summary report are ok.

Any idea? (v2024.10)


arbei
User
Posts: 9390

Post by arbei »

  1. What is your custom template for? For a summary report? You may post your code for discussion.
  2. The route "/export[/{param}[/{table}[/{key:.*}]]]" always exists, are you sure your URL is correct? The correct actual URL should be http(s)://your-host/your-base-path/api/export/pdf/xxx.

airdriver
User
Posts: 9

Post by airdriver »

CustomTemplateHeader:

<table class="ew-table no-border">
<tr>
<td><strong>Datum</strong></td>
<td></td>
<td><strong>Temp</strong></td>
</tr>
<br>

CustomTemplateBody:

<tr>
<td>{{: {{{dbvalue Datum}}} }}</td>
<td></td>
<td>{{: {{{dbvalue temp}}} }}</td>
</tr>
<br>

a simple example. But I'll start with the templates. However, a PDF export is necessary.
The route is ok, because the report is running. But in the api directory there is only a index.php and a web.config file, nothing else.

I just see that all the reports that I now create under 2024 can no longer be exported, neither PDF nor Excel.


arbei
User
Posts: 9390

Post by arbei »

airdriver wrote:

in the api directory there is only a index.php and a web.config file, nothing else.

You have web.config, are you using IIS? If not, what web server are you using? If Apache, you should have .htaccess.

It is correct that nothing else is there (except that you have enabled the FileManager extension). The index.php does everything for the API.

It seems that there is something wrong in the URL Rewrite of the API folder. Does your website have a base path, e.g. http(s)://your-host/your-base-path/api/export/pdf/xxx? If you use IIS, you may post the content of the api folder's web.config for discussion?


airdriver
User
Posts: 9

Post by airdriver »

I use apache. in the folder api are only 2 files: index.php and web.config.
I have 15 projects, they are from 2022 phpmaker. There is the same content in the api folder and the exports are running.
The exports doesn't run in v2024.


arbei
User
Posts: 9390

Post by arbei »

arbei wrote:

If Apache, you should have .htaccess.

You might have not uploaded all the generated files.

Read URL Rewrite for details.


airdriver
User
Posts: 9

Post by airdriver »

If I create a new report under 2024 and not import (convert) one from 2022, then the export works.

Thank you.


Post Reply