<?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: Create a Download Link For Dynamic PDF File in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/848257#M16721</link>
    <description>&lt;P&gt;It sounds like you are looking for a way to create a PDF file that contains the payment details and notes for a specific set of payments based on certain filters (e.g. supplier ID and date range). In SAS, you can use the &lt;CODE&gt;PROC REPORT&lt;/CODE&gt; procedure to create a report containing the payment details and notes, and then use the &lt;CODE&gt;ODS PDF&lt;/CODE&gt; statement to save the report as a PDF file.&lt;/P&gt;
&lt;P&gt;Here is an example of how you might do this in SAS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC REPORT DATA=mydata;
  WHERE supplier_id IN (123, 456, 789) AND payment_date BETWEEN '01JAN2022' AND '31DEC2022';
  COLUMNS payment_id, payment_date, payment_amount, notes;
  DEFINE payment_id / GROUP;
  DEFINE payment_date / ORDER;
  DEFINE payment_amount / SUM;
  DEFINE notes / DISPLAY;
  BREAK AFTER payment_id / SKIP;
  COMPUTE after payment_id;
    LINE 'Notes:';
  ENDCOMP;
  COMPUTE after notes;
    LINE @2 '--------------------------------';
  ENDCOMP;
RUN;

ODS PDF FILE='payment_notes.pdf';
  PROC REPORT DATA=mydata;
    WHERE supplier_id IN (123, 456, 789) AND payment_date BETWEEN '01JAN2022' AND '31DEC2022';
    COLUMNS payment_id, payment_date, payment_amount, notes;
    DEFINE payment_id / GROUP;
    DEFINE payment_date / ORDER;
    DEFINE payment_amount / SUM;
    DEFINE notes / DISPLAY;
    BREAK AFTER payment_id / SKIP;
    COMPUTE after payment_id;
      LINE 'Notes:';
    ENDCOMP;
    COMPUTE after notes;
      LINE @2 '--------------------------------';
    ENDCOMP;
  RUN;
ODS PDF CLOSE;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;In this example, the &lt;/SPAN&gt;&lt;CODE&gt;PROC REPORT&lt;/CODE&gt;&lt;SPAN&gt; statement creates a report that includes the payment details and notes for payments made by the specified suppliers within the specified date range. The &lt;/SPAN&gt;&lt;CODE&gt;ODS PDF&lt;/CODE&gt;&lt;SPAN&gt; statement is used to save the report as a PDF file named &lt;/SPAN&gt;&lt;CODE&gt;payment_notes.pdf&lt;/CODE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want to pass parameters from SAS VA to SAS Portal, you can do so using the &lt;CODE&gt;SASVA&lt;/CODE&gt; function in SAS Portal. This function allows you to access the current value of a SAS VA parameter from within a SAS Portal report. For example, if you have a SAS VA parameter named &lt;CODE&gt;p_supplier_id&lt;/CODE&gt; that contains the ID of the selected supplier, you can use the following code in SAS Portal to access the value of that parameter:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  supplier_id = SASVA('p_supplier_id');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then use the &lt;CODE&gt;supplier_id&lt;/CODE&gt; variable in your &lt;CODE&gt;PROC REPORT&lt;/CODE&gt; code to filter the payment data based on the selected supplier ID.&lt;/P&gt;
&lt;P&gt;I hope this helps! If you have any other questions, please let me know.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2022 02:00:03 GMT</pubDate>
    <dc:creator>webart999ARM</dc:creator>
    <dc:date>2022-12-07T02:00:03Z</dc:date>
    <item>
      <title>Create a Download Link For Dynamic PDF File</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/847533#M16716</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm developing a dashboard that shows payments to clients from multiple suppliers. One of the data sets contains individual payment details (Supplier -&amp;gt; Client) and that is linked to a notes dataset that shows any notes that staff have entered in about the individual payments. I have the notes popping up in a window when the user double clicks a payment in a table.&lt;/P&gt;
&lt;P&gt;The users have asked if I can, from the dashboard, create a link or button to download a PDF file showing all notes associated with payments in one file based on the report filters. The report filters are Suppliers ID/Name and Date Range.&lt;/P&gt;
&lt;P&gt;Ideally I'd have, for each payment, the details of the payment followed by the note in date order. Is this possible?&lt;/P&gt;
&lt;P&gt;I'm thinking if I can create the PDF code in SAS Portal then pass parameters to the Portal from SAS VA it would work? Preferably it would use the same data sets so I wouldn't have to replicate them?&lt;/P&gt;
&lt;P&gt;Any pointers really appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a side question does anyone know how to get SAS VA to honour line breaks in long text fields?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 02:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/847533#M16716</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2022-12-03T02:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Download Link For Dynamic PDF File</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/848257#M16721</link>
      <description>&lt;P&gt;It sounds like you are looking for a way to create a PDF file that contains the payment details and notes for a specific set of payments based on certain filters (e.g. supplier ID and date range). In SAS, you can use the &lt;CODE&gt;PROC REPORT&lt;/CODE&gt; procedure to create a report containing the payment details and notes, and then use the &lt;CODE&gt;ODS PDF&lt;/CODE&gt; statement to save the report as a PDF file.&lt;/P&gt;
&lt;P&gt;Here is an example of how you might do this in SAS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC REPORT DATA=mydata;
  WHERE supplier_id IN (123, 456, 789) AND payment_date BETWEEN '01JAN2022' AND '31DEC2022';
  COLUMNS payment_id, payment_date, payment_amount, notes;
  DEFINE payment_id / GROUP;
  DEFINE payment_date / ORDER;
  DEFINE payment_amount / SUM;
  DEFINE notes / DISPLAY;
  BREAK AFTER payment_id / SKIP;
  COMPUTE after payment_id;
    LINE 'Notes:';
  ENDCOMP;
  COMPUTE after notes;
    LINE @2 '--------------------------------';
  ENDCOMP;
RUN;

ODS PDF FILE='payment_notes.pdf';
  PROC REPORT DATA=mydata;
    WHERE supplier_id IN (123, 456, 789) AND payment_date BETWEEN '01JAN2022' AND '31DEC2022';
    COLUMNS payment_id, payment_date, payment_amount, notes;
    DEFINE payment_id / GROUP;
    DEFINE payment_date / ORDER;
    DEFINE payment_amount / SUM;
    DEFINE notes / DISPLAY;
    BREAK AFTER payment_id / SKIP;
    COMPUTE after payment_id;
      LINE 'Notes:';
    ENDCOMP;
    COMPUTE after notes;
      LINE @2 '--------------------------------';
    ENDCOMP;
  RUN;
ODS PDF CLOSE;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;In this example, the &lt;/SPAN&gt;&lt;CODE&gt;PROC REPORT&lt;/CODE&gt;&lt;SPAN&gt; statement creates a report that includes the payment details and notes for payments made by the specified suppliers within the specified date range. The &lt;/SPAN&gt;&lt;CODE&gt;ODS PDF&lt;/CODE&gt;&lt;SPAN&gt; statement is used to save the report as a PDF file named &lt;/SPAN&gt;&lt;CODE&gt;payment_notes.pdf&lt;/CODE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want to pass parameters from SAS VA to SAS Portal, you can do so using the &lt;CODE&gt;SASVA&lt;/CODE&gt; function in SAS Portal. This function allows you to access the current value of a SAS VA parameter from within a SAS Portal report. For example, if you have a SAS VA parameter named &lt;CODE&gt;p_supplier_id&lt;/CODE&gt; that contains the ID of the selected supplier, you can use the following code in SAS Portal to access the value of that parameter:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  supplier_id = SASVA('p_supplier_id');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then use the &lt;CODE&gt;supplier_id&lt;/CODE&gt; variable in your &lt;CODE&gt;PROC REPORT&lt;/CODE&gt; code to filter the payment data based on the selected supplier ID.&lt;/P&gt;
&lt;P&gt;I hope this helps! If you have any other questions, please let me know.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 02:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/848257#M16721</guid>
      <dc:creator>webart999ARM</dc:creator>
      <dc:date>2022-12-07T02:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Download Link For Dynamic PDF File</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/848258#M16722</link>
      <description>&lt;P&gt;And answer to your side question.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Yes, SAS Visual Analytics (VA) has a built-in option for displaying line breaks in long text fields. To enable this option, follow these steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In SAS VA, open the Properties pane for the table or graph that contains the long text field.&lt;/LI&gt;
&lt;LI&gt;In the Data section, click the Edit button next to the long text field.&lt;/LI&gt;
&lt;LI&gt;In the Edit Field dialog box, go to the Display section.&lt;/LI&gt;
&lt;LI&gt;Select the "Treat long text as multiple lines" option.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This option will cause SAS VA to display line breaks in the long text field as actual line breaks, rather than displaying the entire text as a single line.&lt;/P&gt;
&lt;P&gt;If you want to control the line breaks more precisely, you can use the &lt;CODE&gt;PUT&lt;/CODE&gt; function in SAS to insert line breaks into the text at specific points. For example, if you have a character variable named &lt;CODE&gt;mytext&lt;/CODE&gt; that contains long text, you can use the following code to insert a line break after every 50 characters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;mytext = PUT(mytext, $char50.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;You can then use the &lt;/SPAN&gt;&lt;CODE&gt;mytext&lt;/CODE&gt;&lt;SPAN&gt; variable in your SAS VA table or graph, and the line breaks that you inserted with the &lt;/SPAN&gt;&lt;CODE&gt;PUT&lt;/CODE&gt;&lt;SPAN&gt; function will be displayed in the table or graph.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 02:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/848258#M16722</guid>
      <dc:creator>webart999ARM</dc:creator>
      <dc:date>2022-12-07T02:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Download Link For Dynamic PDF File</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/848616#M16725</link>
      <description>&lt;P&gt;Hi, thanks so much for replying!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll definitely pursue the ideas re the interaction between VA and the portal - the SASVA function will be the key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not seeing the options you suggest for the formatting of the long text though? I'm using Release 8.5.1 and Viya V.03.05 - is this functionality a recent thing?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 19:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Create-a-Download-Link-For-Dynamic-PDF-File/m-p/848616#M16725</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2022-12-08T19:18:28Z</dc:date>
    </item>
  </channel>
</rss>

