<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VBScript to export a report to PDF with Microsoft Print to PDF with automatic name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1649124#M593250</link>
    <description>&lt;P&gt;Ana, I may have found your problem, possibly, at least one part of it, you may have the wrong Qlik API here, but you are correct, that API is one of ours.&amp;nbsp; I did a quick search in the API Guide QVW and there are two versions of that API, the one you are using but also one called PrintReportEx, which is going to be the one you need to use if you have an Ajax client trying to do things, as otherwise things are going to only run server-side etc.&amp;nbsp; I just wanted to point that part out, but I do not think that likely answers your underlying question.&lt;/P&gt;
&lt;P&gt;The thing I just caught though is the PrintReport API does have 3 parameters whereas the PrintReportEx API only has a single parameter, the Report ID, the other one has the following parameteres:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PrintReportAPIParameters.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24067i8E0163043FCBBAC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="PrintReportAPIParameters.png" alt="PrintReportAPIParameters.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hopefully that may allow you to get the print dialog to show and be able to change something there, or if you try the Ex version, I suspect that likely pops up the dialog as well.&amp;nbsp; Hopefully this may help.&amp;nbsp; Just FYI on the Edit Module, I believe the version of VB that is based upon is 3 if I am not mistaken! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Brett&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2019 13:30:36 GMT</pubDate>
    <dc:creator>Brett_Bleess</dc:creator>
    <dc:date>2019-11-20T13:30:36Z</dc:date>
    <item>
      <title>VBScript to export a report to PDF with Microsoft Print to PDF with automatic name</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1646896#M593247</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We had a macro printing out reports to PDF with Bullzip. New version of the reports contain pictures and we have noticed that if we print with Microsoft Print to PDF the pic quality is much better and therfore would like to switch. The part i am struggling with is how to supress the 'save as' window and save to the&amp;nbsp; path &amp;amp; name given in macro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code so far is:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Function printReportPDF(pdfOutputFile)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Set WSHShell = CreateObject("WScript.Shell")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;WSHShell.RegWrite "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Microsoft Print to PDF\OutputFile", pdfOutputFile, "REG_SZ"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;WSHShell.RegWrite "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Microsoft Print to PDF\BypassSaveAs", "1", "REG_SZ"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Set WSHShell = nothing&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;End function&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;sub PrintUnitReport2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;reportFolder = getVariable("ReportFolder")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;reportFile = getVariable("vUnitFileName2")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;fullpath = reportFolder &amp;amp; reportFile&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;printReportPDF fullpath&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;ActiveDocument.PrintReport "RP01", "Microsoft Print to PDF", false&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;end sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It&amp;nbsp; does print, but promts 'Save as' window and seems to ignore the function printReportPDF . Any help is highly appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:40:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1646896#M593247</guid>
      <dc:creator>foan_a</dc:creator>
      <dc:date>2024-11-16T19:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript to export a report to PDF with Microsoft Print to PDF with automatic name</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1648585#M593248</link>
      <description>&lt;P&gt;Ana, I would expect the proper place to dig into this one is actually on the Microsoft Forums, as they are going to be the experts on how to call the Microsoft Print to PDF as well as any parameters etc...&lt;/P&gt;
&lt;P&gt;Here are a couple of things I found:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/31896952/how-to-programmatically-print-to-pdf-file-without-prompting-for-filename-in-c-sh" target="_blank"&gt;https://stackoverflow.com/questions/31896952/how-to-programmatically-print-to-pdf-file-without-prompting-for-filename-in-c-sh&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://social.msdn.microsoft.com/Forums/en-US/bb4e896b-2440-44ba-a7bf-62e852a46144/printing-a-pdf-file-using-windows-api?forum=Vsexpressvb" target="_blank"&gt;https://social.msdn.microsoft.com/Forums/en-US/bb4e896b-2440-44ba-a7bf-62e852a46144/printing-a-pdf-file-using-windows-api?forum=Vsexpressvb&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Not sure they are exactly what you need, but may give you some further things to try.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 14:33:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1648585#M593248</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-11-19T14:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript to export a report to PDF with Microsoft Print to PDF with automatic name</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1649095#M593249</link>
      <description>&lt;P&gt;Hi Brett,&lt;/P&gt;&lt;P&gt;Thank you for your answer. The first link offers a solution but for c# and unfortunately, to my knowledge you cannot write a macro in c# inside a QlikView document. Other posts in the links relate to VBS but for the files which already are created and saved as pdf. My challenge is to export a Qlik Report and save it as good quality pdf, no actual printing is needed.&lt;/P&gt;&lt;P&gt;The reason I did not post on some Microsoft forums is that Qlik VBS is not the classical VBS either. I beleive the commonly used call 'ActiveDocument.PrintReport' is specific for QlikView. And what instance it creates is unknown to me which creates questions weather PrintFile() or PrintOut() VB-functions could be used (failed so far during my experiments).&lt;/P&gt;&lt;P&gt;I also found some related questions on just Microsoft forum with no proper answer. I can probably anyway post my own question and see if I can get some help there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 13:00:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1649095#M593249</guid>
      <dc:creator>foan_a</dc:creator>
      <dc:date>2019-11-20T13:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript to export a report to PDF with Microsoft Print to PDF with automatic name</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1649124#M593250</link>
      <description>&lt;P&gt;Ana, I may have found your problem, possibly, at least one part of it, you may have the wrong Qlik API here, but you are correct, that API is one of ours.&amp;nbsp; I did a quick search in the API Guide QVW and there are two versions of that API, the one you are using but also one called PrintReportEx, which is going to be the one you need to use if you have an Ajax client trying to do things, as otherwise things are going to only run server-side etc.&amp;nbsp; I just wanted to point that part out, but I do not think that likely answers your underlying question.&lt;/P&gt;
&lt;P&gt;The thing I just caught though is the PrintReport API does have 3 parameters whereas the PrintReportEx API only has a single parameter, the Report ID, the other one has the following parameteres:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PrintReportAPIParameters.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24067i8E0163043FCBBAC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="PrintReportAPIParameters.png" alt="PrintReportAPIParameters.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hopefully that may allow you to get the print dialog to show and be able to change something there, or if you try the Ex version, I suspect that likely pops up the dialog as well.&amp;nbsp; Hopefully this may help.&amp;nbsp; Just FYI on the Edit Module, I believe the version of VB that is based upon is 3 if I am not mistaken! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 13:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-to-export-a-report-to-PDF-with-Microsoft-Print-to-PDF/m-p/1649124#M593250</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-11-20T13:30:36Z</dc:date>
    </item>
  </channel>
</rss>

