Export Helper Class

Post Reply
digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Export Helper Class

Post by digitalphotoworld »

I suggest a helper class/function for exporting data.

Of course it is possible to have export options for a "normal" table or a "view/custom-view" with PHPMaker since some years. But if someone is using a custompage, there is no build-in export functionality. And it is not very handy to create a View or Custom-View for each little export that is needed. Export is only possible if there is bunch of related files (list.php/info.php).

For example, the function should called like this: CustomExport($array1, $array2);

The $array1 contains the data to export and the $array2 contains how the data should exported. Possible parameters should be
$Type -> XML / CSV / PDF / XLS / DOC
$Filename -> The name of the file
$Rootelement -> If export is XML, the name of the root Element
$PageSize -> For PDF only
$PageOrientation -> For PDF only
etc.

With a function like this, it would very easy to export all sort of data. And it would very easy to create a Download-area for some user-groups that have access to all sort of data.


Post Reply