• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Export to CSV without using dialog

  • Views Views: 12,470
  • Last updated Last updated:

Navigation

  • Fabrik 3.0 +​


    You should use the CSV Fabrik menu item type.(Fabrik3.9: CSV menu item type doesn't do. You may create menu item type System/URL and use the export URL, see below).

    Starting from Fabrik 3.3.4 you can also use the URL:

    index.php?option=com_fabrik&view=list&listid=listid&format=csv&download=1

    You can append variables to the$url value to alter the output of the CSV file. These correspond with the settings located on the export CSV dialog box:
    • incraw=0 or 1
    • incfilters=0 or 1
    • inctabledata=0 or 1
    • inccalcs=0 or 1
    • excel=0 or 1
    By default this will export all of the table's Elements. If you want to specify which element's are exported append the following the url:

    Code:
    &fields[tablename___elementname]=1&fields[tablename___elementname2]=1


    Fabrik 2.0 only:​


    If you don't want to show the CSV export dialog then you can achieve a direct export to CSV by adding this into your table template. Templates are found in components/com_fabrik/views/table/tmpl
    PHP:
    <?php $url = "index.php?option=com_fabrik&c=table&view=table&format=csv&tableid={$this->table->id}&task=viewTable";?>
    <span class="csvExportButton custom">
    <a href="Javascript:oPackage.blocks.get('table_<?php echo $this->table->id;?>').triggerCSVImport(0, <?php echo $url'?>);">Export as CSV</a>
    </span>
    Note the span's 'custom' class is obligatory, as it stops the default export dialog from opening
Back
Top