PDF handle and Automatic download

(9 posts) (2 voices)
  1. shem, Member

    When &export=pdf is part of the URL I catch it using IF (inExportFormat = 'pdf')

    And I do some special handling for the output.
    But instead of displaying it to the window, I would like it to just download the file.
    How can I cause that to happen?

  2. shem, Member

    In furtherance to my question, I see the documentation has the following paragraph under Export options:
    content-disposition.xxx, 'attachment' | 'inline' - Set export Content-Disposition header to either 'attachment' or 'inline'.
    You can also use URL parameter 'content-disposition' with same options.
    Determines whether the report will be shown in the browser (inline) or downloaded as a file (attachment).

    So what would the syntax be in both ways:
    Would it be
    select 'dbr.export.options', 'content-disposition.pdf', 'attachment';

    and if adding to the url would it be
    https://server/mydbr/report....&export=pdf&content-disposition=attachment
    ?

  3. myDBR Team, Key Master

    The correct command is:

    select 'dbr.export.options', 'content-disposition.pdf', 'attachment';

    See the documentation.

    --
    myDBR Team

  4. shem, Member

    Thanks, but I also need to know the second way of doing it.
    The documentation says
    You can also use URL parameter 'content-disposition' with same options.
    Please tell me the syntax for that:
    Is it
    https://server/mydbr/report....&export=pdf&content-disposition=attachment
    ?

    p.s. Am I correct in assuming that since the documentation only mentions URL regarding ontent-disposition, that the other export options will not work when specified on the URL itself?

  5. myDBR Team, Key Master

    You can use the &content-disposition=attachment to override the export option set in the report.

    If you have a command:

    select 'dbr.export.options', 'content-disposition.pdf', 'inline';

    You can use the &content-disposition=attachment in the URL to override it.

    --
    myDBR Team

  6. shem, Member

    So are you saying that the URL parameter
    &content-disposition=attachment
    is ignored, if I my report does not have a
    select 'dbr.export.options', 'content-disposition.pdf',
    statement in the stored procedure itself.
    I was hoping, to have it ONLY in the URL.

  7. myDBR Team, Key Master

    With the latest build it is enough to just use the URL parameter.

    --
    myDBR Team

  8. shem, Member

    Thanks.
    And with the new build (I assume you mean version 6.6),if I have &content-disposition=attachment (is that the correct syntax?) in the URL, but in the report itself I have
    select 'dbr.export.options', 'content-disposition.pdf', 'inline';
    which one overrides which?

  9. myDBR Team, Key Master

    Run the updater to get the latest build and you do not need to use 'dbr.export.options', 'content-disposition.pdf', The URL parameter is enough. If you use both, the URL parameter will be the one used.

    --
    myDBR Team


Reply

You must log in to post.