Page 1 of 1

Export Log (v2023)

Posted: Sun Apr 28, 2024 5:44 am
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.


Re: AbstractExportBase not found (v2023)

Posted: Mon Apr 29, 2024 1:30 pm
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?


Re: Export Log (v2023)

Posted: Tue Apr 30, 2024 9:42 am
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.

Re: Export Log (v2023)

Posted: Thu May 02, 2024 4:46 pm
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