Export Log (v2023)

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

Export Log (v2023)

Post by philmills »

I'm using this classs to extend ExportPdf, but it causes an error if I turn on Export Log.
Fatal error: Uncaught Error: Class "PHPMaker2023\MyProject\AbstractExportBase" not found in /home/[path to site]/src/AbstractExport.php

class MyExportPdf extends ExportPdf {
    // Override exportTableheader()
    public function exportTableHeader() {
        //make sure that table headers for detail tables are also exported
        $this->Text .= "<h2 style='font-family: Arial, Helvetica, sans-serif*; padding-top: 10px; page-break-before: avoid; page-break-after: avoid'>" . $this->Table->tableCaption() . "</h2>"; // Add table caption
        parent::exportTableHeader(); // Call the parent method
    }    
}
Config('EXPORT_CLASSES.pdf', 'MyExportPdf'); // Replace the default ExportPDF class by your own class
Config('PAGE_BREAK_HTML', '<div style="page-break-after:avoid; page-break-inside: avoid; page-break-before: avoid;"></div>');

the class is created correctly
If i comment out the code I just posted, there is no error.
So I think the problem is that I'm extending ExportPdf when class ExportPdf extends AbstractExport.
I don't understand how that works fully, all i know is that extending ExportPdf causes the error.


philmills
User
Posts: 566

Post by philmills »

I have now regenerated all files and overwriiten all existing files on my test site.
The exports are working correctly.
BUT
The only problem now is that Export log, is not logging anything at all.
Even with code commented out, Exports are not being logged.
Why? and how can I fix that?


arbei
User
Posts: 9419

Post by arbei »

If you meant the Export Log Table, note that by default it is for Export API with "save" parameter only:

  1. The Export API allows you to export snapshots from tables/views/reports and save them as physical files on server so they can be retrieved later. To use the Export API, you must first set up the Export Log Table to keep track of the exported files.
  2. For Export API requests with "filename" and "save" parameters specified, the exported file will be saved and you can use the Export API to retrieve the file later.

philmills
User
Posts: 566

Post by philmills »

Ah ...
In that case I misunderstood the Export log feature.
I though it would create a log of all exports performed, not just API exports


Post Reply