<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="https://www.schweda.net/style_feed.css" ?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:atom="http://www.w3.org/2005/Atom"	
	xmlns:dc="http://purl.org/dc/elements/1.1/" > 
<channel>
    <title>schweda.net - Blog</title>
    <link>https://www.schweda.net/</link>
    <description>schweda.net - Blog - Blog-Beitraege</description>
    <language>de-at</language>
    <copyright>Copyright 2006-2026</copyright>
    <generator>schweda.net</generator>
    <managingEditor>heinz.schweda@schweda.net (Heinz Schweda)</managingEditor>
    <webMaster>heinz.schweda@schweda.net (Heinz Schweda)</webMaster>
    <category>Blog</category>
	<atom:link href="https://schweda.net/blog_rss.php?bid=547" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[Lieferschein per Code drucken]]></title>
<description><![CDATA[
<p>Der nachstehende Job demonstriert, wie man in Dynamics AX 2012 einen vorhandenen (Ausgangs-)Lieferschein per Code (nach-)drucken kann. Im Beispiel erfolgt die Ausgabe am Bildschirm.
</p>


<pre class="pre_blog_axcode">
static void printSalesPackingSlipThroughCode(Args _args)
{
    SalesPackingSlipJournalPrint salesPackingSlipJournalPrint;
    Set set = new Set(Types::Record);
    SRSPrintDestinationSettings srsPrintDestinationSettings;

    // Add record
    set.add(CustPackingSlipJour::findRecId(5637161120));

    // Set printer settings
    srsPrintDestinationSettings = new SRSPrintDestinationSettings();
    srsPrintDestinationSettings.fileFormat(SRSReportFileFormat::Screen);

    // Initalize
    salesPackingSlipJournalPrint = SalesPackingSlipJournalPrint::construct();
    salesPackingSlipJournalPrint.parmPrintFormletter(NoYes::Yes);
    salesPackingSlipJournalPrint.parmUsePrintManagement(false);
    salesPackingSlipJournalPrint.parmPrinterSettingsFormLetter(srsPrintDestinationSettings.pack());

    // Print
    salesPackingSlipJournalPrint.printJournal(set);
}
</pre>



<p>&Auml;ndert man die Parameter der SRSPrintDestinationSettings kann man den Bericht nat&uuml;rlich auch an einen Drucker senden, eine Datei erstellen oder den Bericht per Mail versenden.
</p>


<pre class="pre_blog_axcode">
static void printSalesPackingSlipThroughCode(Args _args)
{
    SalesPackingSlipJournalPrint salesPackingSlipJournalPrint;
    Set set = new Set(Types::Record);
    SRSPrintDestinationSettings srsPrintDestinationSettings;

    // Add record
    set.add(CustPackingSlipJour::findRecId(5637161120));

    // Set printer settings
    srsPrintDestinationSettings = new SRSPrintDestinationSettings();
    srsPrintDestinationSettings.fileFormat(SRSReportFileFormat::PDF);
    srsPrintDestinationSettings.fileName(@&#39;c:&#092;temp&#092;packingslip.pdf&#39;);
    srsPrintDestinationSettings.printMediumType(SRSPrintMediumType::File);
    srsPrintDestinationSettings.numberOfCopies(1);
    srsPrintDestinationSettings.overwriteFile(true);

    // Initalize
    salesPackingSlipJournalPrint = SalesPackingSlipJournalPrint::construct();
    salesPackingSlipJournalPrint.parmPrintFormletter(NoYes::Yes);
    salesPackingSlipJournalPrint.parmUsePrintManagement(false);
    salesPackingSlipJournalPrint.parmPrinterSettingsFormLetter(srsPrintDestinationSettings.pack());

    // Print
    salesPackingSlipJournalPrint.printJournal(set);
}
</pre>




<p>Weiters kann man auf diese Art &amp; Weise auch mehrere Lieferscheine auf einmal drucken, dazu muss man lediglich die entsprechenden <em>CustPackingSlipJour</em>-Datens&auml;tze dem Set &quot;set&quot; hinzuf&uuml;gen:
</p>


<pre class="pre_blog_axcode">
    ...    
    // Add record
    set.add(CustPackingSlipJour::findRecId(5637155842));
    set.add(CustPackingSlipJour::findRecId(5637145354));
    ...
</pre>




<p>Wer den Lieferschein zus&auml;tzlich noch im Druckarchiv speichern m&ouml;chte, kann dies durch folgende Zeile erreichen:
</p>


<pre class="pre_blog_axcode">
    ...    
    srsPrintDestinationSettings.parmPrintToArchive(true);
    ...
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 29 Nov 2014 19:08:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=547</link>
<comments>https://www.schweda.net/blog_ax.php?bid=547</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=547</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=547</wfw:commentRss>
</item>
<item>
<title>Kommentar von roger</title>
<description><![CDATA[Thanks for de DEMO. When I save packingslip to a file, it generates two files. the desired one and same file into temp folder. Do you know why?]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 08 Jul 2021 17:40:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=547</link>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=547</guid>
<author>roger</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heinz Schweda</dc:creator>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=547</wfw:commentRss>
</item>
</channel>
</rss>	
