<?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: Macro To Generate multiple file with different file name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942774#M1219415</link>
    <description>&lt;P&gt;Instead of using&amp;nbsp;&lt;SPAN&gt;PDF-XChange 3.0, there is another way to use for example Microsoft Print to PDF ?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2022 11:15:45 GMT</pubDate>
    <dc:creator>Fitus9092</dc:creator>
    <dc:date>2022-06-13T11:15:45Z</dc:date>
    <item>
      <title>Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1941526#M1219350</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;i'm using this VBscript code to generate multiple pdf file for each value of the field&amp;nbsp;"cdr cod".&lt;/P&gt;
&lt;P&gt;Sub ReportPrint&lt;/P&gt;
&lt;P&gt;Set soc = ActiveDocument.Fields("cdr cod")&lt;/P&gt;
&lt;P&gt;Set socPossible = soc.GetPossibleValues&lt;/P&gt;
&lt;P&gt;For i = 0 to socPossible.Count-1&lt;/P&gt;
&lt;P&gt;soc.Select socPossible.Item(i).Text&lt;/P&gt;
&lt;P&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;
&lt;P&gt;ActiveDocument.PrintDocReport "RP01", "PDF-XChange 3.0", false&lt;/P&gt;
&lt;P&gt;Next&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;
&lt;P&gt;It works, but how i can set a file path and save automatically each file name with each value in "cdr cod"?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: value1.pdf, value2.pdf etc.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 10:14:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1941526#M1219350</guid>
      <dc:creator>Fitus9092</dc:creator>
      <dc:date>2022-06-09T10:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1941585#M1219353</link>
      <description>&lt;P&gt;Probably it's possible by changing the configurations from the used printer&amp;nbsp;&lt;SPAN&gt;PDF-XChange 3.0 - within the registry or any config-files like it was possible with the old QlikView pdf-printer. Some years ago I looked myself for it but didn't found the right ones - whereby I didn't searched for long else moved rather quickly for a bypass-logic which is quite simple:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;creating a default store-folder in C:\PrintTemp and using the print-properties to set this folder as default and disabling there any dialog for the saving-task&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;moving the pdf-file after the saving to the target-place by renaming it in the same statement&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;This means you need to add the following within your loop-code to get it to working:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;...&lt;BR /&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;...&lt;BR /&gt;ActiveDocument.GetApplication.Sleep 1000&lt;BR /&gt;...&lt;BR /&gt;objFSO.MoveFile &lt;STRONG&gt;sPDFPath_src, PDFFullName&lt;/STRONG&gt;&lt;BR /&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The bold ones are variables which you could set like you want but of course they must be a valid full-path. The sleep-statements - you may need multiple ones with n milliseconds between your various steps to ensure that the files were already stored and moved before the next loop-iteration runs - it depends mostly on the minimal performance of your storage/network.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 11:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1941585#M1219353</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-06-09T11:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942089#M1219375</link>
      <description>&lt;P&gt;It doesn't work&lt;/P&gt;
&lt;P&gt;Sub ReportPrint&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim sPDFName&lt;/P&gt;
&lt;P&gt;Dim sPDFPath&lt;BR /&gt;&lt;BR /&gt;Set soc = ActiveDocument.Fields("cdr cod")&lt;/P&gt;
&lt;P&gt;Set socPossible = soc.GetPossibleValues&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For i = 0 to socPossible.Count-1&lt;/P&gt;
&lt;P&gt;soc.Select socPossible.Item(i).Text&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sPDFName = selo.Item(i).text &amp;amp; ".pdf"&lt;BR /&gt;&lt;BR /&gt;sPDFPath = "C:\Users\bho\"&lt;BR /&gt;&lt;BR /&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;
&lt;P&gt;ActiveDocument.PrintDocReport "RP01", "PDF-XChange 3.0", false&lt;/P&gt;
&lt;P&gt;ActiveDocument.GetApplication.Sleep 1000&lt;/P&gt;
&lt;P&gt;objFSO.MoveFile "sPDFPath"&amp;amp;sPDFName, "sPDFPath" &amp;amp;sPDFName&lt;/P&gt;
&lt;P&gt;Next&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 10:01:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942089#M1219375</guid>
      <dc:creator>Fitus9092</dc:creator>
      <dc:date>2022-06-10T10:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942120#M1219376</link>
      <description>&lt;P&gt;What didn't work - nothing happens, not the right/expected things, any error occurred (where and with which message)?&lt;/P&gt;
&lt;P&gt;The line:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;should in general work within the loop but it's better to place it above.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Further helpful would be to use some message-boxes to display the variable-values to see if they contain the right content.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Beside this I mentioned above various settings within the printer-properties - were they applied?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 11:16:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942120#M1219376</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-06-10T11:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942767#M1219413</link>
      <description>&lt;P&gt;Yes i did the print settings as you said and i changed the&amp;nbsp;Set objFSO = CreateObject("Scripting.FileSystemObject") above the loop.&lt;/P&gt;
&lt;P&gt;But still don't work, after print the first value in the temp folder he stop the run without giving any error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim sPDFName&lt;/P&gt;
&lt;P&gt;Dim sPDFPath&lt;BR /&gt;&lt;BR /&gt;Set soc = ActiveDocument.Fields("cdr cod")&lt;/P&gt;
&lt;P&gt;Set socPossible = soc.GetPossibleValues&lt;BR /&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;
&lt;P&gt;For i = 0 to socPossible.Count-1&lt;/P&gt;
&lt;P&gt;soc.Select socPossible.Item(i).Text&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sPDFName = socPossible.Item(i).text &amp;amp; ".pdf"&lt;BR /&gt;&lt;BR /&gt;sPDFPath = "C:\Users\bho\"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.GetApplication.WaitForIdle&lt;/P&gt;
&lt;P&gt;ActiveDocument.PrintDocReport "RP01", "PDF-XChange 3.0", false&lt;/P&gt;
&lt;P&gt;ActiveDocument.GetApplication.Sleep 1000&lt;/P&gt;
&lt;P&gt;objFSO.MoveFile "sPDFPath"&amp;amp;sPDFName, "sPDFPath" &amp;amp;sPDFName&lt;/P&gt;
&lt;P&gt;Next&lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 10:24:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942767#M1219413</guid>
      <dc:creator>Fitus9092</dc:creator>
      <dc:date>2022-06-13T10:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942774#M1219415</link>
      <description>&lt;P&gt;Instead of using&amp;nbsp;&lt;SPAN&gt;PDF-XChange 3.0, there is another way to use for example Microsoft Print to PDF ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 11:15:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942774#M1219415</guid>
      <dc:creator>Fitus9092</dc:creator>
      <dc:date>2022-06-13T11:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942785#M1219416</link>
      <description>&lt;P&gt;At least this part isn't correct:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;objFSO.MoveFile &lt;STRONG&gt;"sPDFPath"&amp;amp;sPDFName, "sPDFPath" &amp;amp;sPDFName&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;because source and target are the same. It should look more like:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;objFSO.MoveFile "C:\PrintTemp\&lt;STRONG&gt;Default&lt;/STRONG&gt;.pdf", "D:\Folder\" &amp;amp; sPDFName&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The file-name isn't Default - you need to look how it's called which could be also defined within the printer-properties.&lt;/P&gt;
&lt;P&gt;Like above mentioned it's helpful to use msgbox to display any variable-content to see if it worked like expected. Also the moving-part with the renaming might be tested separately just with any dummy-files.&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 11:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942785#M1219416</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-06-13T11:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942788#M1219418</link>
      <description>&lt;P&gt;AFAIK QlikView changed already the default-printer with 12.6 to the Microsoft Print to PDF - what probably means that they just left to deliver an own (sold) pdf-printer because the MS printer is already on all current systems. Therefore you may try to switch to it whereby I don't know how it could be configured. Maybe you find something already here in the community. Otherwise you need to search directly by MS.&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 11:30:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1942788#M1219418</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-06-13T11:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro To Generate multiple file with different file name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1943123#M1219439</link>
      <description>&lt;P&gt;I did it.&lt;/P&gt;
&lt;P&gt;Many thanks Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 05:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-To-Generate-multiple-file-with-different-file-name/m-p/1943123#M1219439</guid>
      <dc:creator>Fitus9092</dc:creator>
      <dc:date>2022-06-14T05:53:11Z</dc:date>
    </item>
  </channel>
</rss>

