Limit export option to only PDF

(9 posts) (3 voices)

Tags:

No tags yet.

  1. -nth-, Member

    I thought I read somewhere in the documentation there's a way to limit what types of exports can be done, but I can't find it again. We've got several reports that we'd like to have PDF only export (to prevent download of csv or excel data). If this is possible, how do I accomplish it.

    Thanks,
    -nth-

  2. myDBR Team, Key Master

    You can limit the export types, but for now it is the same setting for all reports.

    You can change the export types by overriding the $mydbr_defaults['export']['export_choises'] in mydbr/user/defaults.php. See mydbr/defaults.php for current values.

    We could make this an option that could be changed per report.

    --
    myDBR Team

  3. -nth-, Member

    Yes, I'd like to see this added as a per report option. Some are OK to download via Excel/csv, but we've had a case in the past where a user downloaded report data, changed it and then said it came from us. :( So there are certain reports we'd like to prevent that from happening on.

    Also maybe consider separating the search box from the export functionality. (Or at least have a way to turn one or the other off)

    I removed the Excel and csv options so that defaults.php shows:


    'export' => array(
    'export_choises' => array('PDF'),
    'colwidth' => 6,
    'pdf' => array(
    'font' => 'Arial',
    'font_size' => 9,
    'font_width' => 8.5, // Arial 10 default width. Increase this if your PDF output produces columns too narrow
    'image_scale' => 101.1,
    'logo' => 'apppic_small.jpg', // in user/images
    'logo_width' => 40
    )

    I don't think this is quite right, because now I'm getting and error in all my report headers: Notice: Undefined index: excel in C:\inetpub\wwwroot\reporting\interface\reportheader.php on line 36 and in the search box: Notice: Undefined index: excel in C:\inetpub\wwwroot\reporting\apps\showReport.php on line 3264

  4. myDBR Team, Key Master

    Hi,
    The file mydbr/defaults.php is the one that comes with the product and contains all necessary definitions. You are not supposed to change the file. All user modifications are done through mydbr/user/defaults.php where you can override the original definitions.

    The error message that you see, comes from the fact that in addition to changing $mydbr_defaults['export']['export_choises'], you have removed the references to $mydbr_defaults['export']['excel'] and $mydbr_defaults['export']['pdf'].

    To correct the situation, restore the original mydbr/defaults.php and add following line to the mydbr/user/defaults.php. This is all that is needed:

    $mydbr_defaults['export']['export_choises'] = array('PDF');

    P.S. Limiting the Excel and csv options out does not really change that much, other than removing the engouragement to export to Excel. If user want to copy the data to Excel (s)he can simply use copy and paste.

    --
    myDBR Team

  5. -nth-, Member

    Yep, I see I didn't read your original post thoroughly enough to catch the change was supposed to be in the user/defaults.php file. It now works as expected.

    Is there also a way to turn off the "copy" button on the search toolbar? It would be great to see the ability to hide and show the search box separated from the copy/export tools! (maybe additional choices added to dbr.search... like "dbr.search, 3" shows only search box and "dbr.search, 4" shows only copy/export tools)

    thanks for the help!

  6. myDBR Team, Key Master

    You can disable the search toolbar altogether. Turning off just the copy-button is not possible.

    Please do remember that even if we turned off the copy-button, user can still copy the data from the browser window.

    --
    myDBR Team

  7. john, Member

    Just searched, and didn't find anything to see a per report download restriction as a feature yet.

    I would actually like to disable pdf everywhere then enable it on a per report basis. Reason is most of our reports are quite large and we only bother to set up the formatting for pdf on a few key reports.

    suppose we could hack a button with a link on those reports and use the export function, but not preferred solution

  8. myDBR Team, Key Master

    You can disable the export functionality, but there is no way of re-enabling it per report.

    If you want the PDF export to be available for just selected reprorts, run the updater to get the latest build and you can take advantage of 'inAutoReportURL' automatic variable, which will contain the URL for the report. To create a 'Export to PDF' button you can then user code:

    select 'dbr.html', concat(' Export to PDF');

    --
    myDBR Team

  9. erasmussen, Member

    This may be a more recent option than was available with the answers above...

    You can now disable report formats per report using the dbr.export.options command. This allows the desired level of granularity, albeit with the requirement that you add the command to all reports where you don't want exports.

    See: https://mydbr.com/doc/content/cmd.export.html

    Example: SELECT 'dbr.export.options', 'disable', 'csv,pdf,excel';


Reply

You must log in to post.