<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Printing reports from code in AX2012	</title>
	<atom:link href="https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/feed/" rel="self" type="application/rss+xml" />
	<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/</link>
	<description>Martin &#34;Goshoom&#34; Dráb - Dynamics AX, .NET and Everything</description>
	<lastBuildDate>Wed, 08 May 2019 17:49:58 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.5</generator>
	<item>
		<title>
		By: Joel		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-117303</link>

		<dc:creator><![CDATA[Joel]]></dc:creator>
		<pubDate>Wed, 08 May 2019 17:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-117303</guid>

					<description><![CDATA[Hi Martin,

Do you know if it&#039;s possible to print the report on both sides of a page w/ code?]]></description>
			<content:encoded><![CDATA[<p>Hi Martin,</p>
<p>Do you know if it&#8217;s possible to print the report on both sides of a page w/ code?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Israel Gonzalez		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-110840</link>

		<dc:creator><![CDATA[Israel Gonzalez]]></dc:creator>
		<pubDate>Tue, 16 Oct 2018 20:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-110840</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-110648&quot;&gt;Martin Dráb&lt;/a&gt;.

Thank you Martin]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-110648">Martin Dráb</a>.</p>
<p>Thank you Martin</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin Dráb		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-110648</link>

		<dc:creator><![CDATA[Martin Dráb]]></dc:creator>
		<pubDate>Fri, 12 Oct 2018 09:12:30 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-110648</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-110627&quot;&gt;Israel Gonzalez&lt;/a&gt;.

I&#039;ve created a D365FO example for you: &lt;a href=&quot;http://dev.goshoom.net/en/2018/10/printing-reports-from-code-in-d365fo/&quot;&gt;http://dev.goshoom.net/en/2018/10/printing-reports-from-code-in-d365fo/&lt;/a&gt;.
You can use it anywhere, e.g. in a table method, although a class is usually the best place for such logic.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-110627">Israel Gonzalez</a>.</p>
<p>I&#8217;ve created a D365FO example for you: <a href="http://dev.goshoom.net/en/2018/10/printing-reports-from-code-in-d365fo/">http://dev.goshoom.net/en/2018/10/printing-reports-from-code-in-d365fo/</a>.<br />
You can use it anywhere, e.g. in a table method, although a class is usually the best place for such logic.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Israel Gonzalez		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-110627</link>

		<dc:creator><![CDATA[Israel Gonzalez]]></dc:creator>
		<pubDate>Thu, 11 Oct 2018 22:16:36 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-110627</guid>

					<description><![CDATA[Hello Martin,

Could you give me a example for D365. Should I create a class for that code?]]></description>
			<content:encoded><![CDATA[<p>Hello Martin,</p>
<p>Could you give me a example for D365. Should I create a class for that code?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin Dráb		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-85089</link>

		<dc:creator><![CDATA[Martin Dráb]]></dc:creator>
		<pubDate>Thu, 10 Dec 2015 15:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-85089</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-85087&quot;&gt;NikoGJ&lt;/a&gt;.

Yes, I&#039;ve seen it before. It&#039;s apparently saved in the report state.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-85087">NikoGJ</a>.</p>
<p>Yes, I&#8217;ve seen it before. It&#8217;s apparently saved in the report state.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: NikoGJ		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-85087</link>

		<dc:creator><![CDATA[NikoGJ]]></dc:creator>
		<pubDate>Thu, 10 Dec 2015 14:06:15 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-85087</guid>

					<description><![CDATA[Hi,

Thanks for the code.
Have you ever encountered trouble using parmShowDialog(false) to suppress the prompt?
I&#039;ve tried on a (custom) report and the dialog always showed up. I had to use parmLoadFromSysLastValue(false) otherwise the showDialog boolean was overwritten...
See ya!
Nicolas]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for the code.<br />
Have you ever encountered trouble using parmShowDialog(false) to suppress the prompt?<br />
I&#8217;ve tried on a (custom) report and the dialog always showed up. I had to use parmLoadFromSysLastValue(false) otherwise the showDialog boolean was overwritten&#8230;<br />
See ya!<br />
Nicolas</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Satish		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-84265</link>

		<dc:creator><![CDATA[Satish]]></dc:creator>
		<pubDate>Wed, 18 Nov 2015 19:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-84265</guid>

					<description><![CDATA[Thanks. But how to run this code? My requirement is I would like to print AX 2012 reports to Excel file in batch mode. I will need to supply report parameters (like Source system, Sorty by, Start date, End date etc). How can I pass the parameters in this code? Appreciate any help. Thanks]]></description>
			<content:encoded><![CDATA[<p>Thanks. But how to run this code? My requirement is I would like to print AX 2012 reports to Excel file in batch mode. I will need to supply report parameters (like Source system, Sorty by, Start date, End date etc). How can I pass the parameters in this code? Appreciate any help. Thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adam		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-69150</link>

		<dc:creator><![CDATA[Adam]]></dc:creator>
		<pubDate>Fri, 20 Jun 2014 15:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-69150</guid>

					<description><![CDATA[Whenever I run this I always get an info box that says:


&quot;The report has been successfully saved as: &quot;

how do I suppress this message?]]></description>
			<content:encoded><![CDATA[<p>Whenever I run this I always get an info box that says:</p>
<p>&#8220;The report has been successfully saved as: &#8221;</p>
<p>how do I suppress this message?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Alex		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-68878</link>

		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Tue, 10 Jun 2014 19:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-68878</guid>

					<description><![CDATA[Martin,

Thanks so much for this post it&#039;s saved me!  Been struggling with some custom printing stuff for a couple days now with 2012.

I&#039;m going to probably do a more detailed blog post based off of this.

Alex]]></description>
			<content:encoded><![CDATA[<p>Martin,</p>
<p>Thanks so much for this post it&#8217;s saved me!  Been struggling with some custom printing stuff for a couple days now with 2012.</p>
<p>I&#8217;m going to probably do a more detailed blog post based off of this.</p>
<p>Alex</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: haragopal		</title>
		<link>https://dev.goshoom.net/2013/11/printing-reports-from-code-in-ax2012/#comment-60561</link>

		<dc:creator><![CDATA[haragopal]]></dc:creator>
		<pubDate>Thu, 23 Jan 2014 06:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://dev.goshoom.net/?p=5992#comment-60561</guid>

					<description><![CDATA[Hi Martin,

I already done some similar kind of example. But in my case i am testing this through Job. Where i can set the report parameters (can take the parameter reference from VS ex:DatesetName_Parametername)in job. But how to use the dynamics parameters in X++ code. example code: This is working fine but i am unable to override default parameters added in query range(say itemid), its taking what is there in report run dailog

static void GenerateSSRSansSave(Args _args)
{
    SrsReportRun srsReportRun;
    //SysMailer mailer = new SysMailer();
    

    srsReportRun = new SrsReportRun(&quot;ReportName.Report1&quot;);

    srsReportRun.init();
    srsReportRun.reportCaption(&quot;InventOnHand&quot;);
    srsReportRun.reportParameter(&quot;InventOnHandBGDS_ViewConfigId&quot;).value(true);
    .
    .
    .    
    
    srsReportRun.showDialog(false);

    // Print to a file named ReportExample in HTML/PDF format.
    srsReportRun.printDestinationSettings().printMediumType(SRSPrintMediumType::File);
    srsReportRun.printDestinationSettings().fileFormat(SRSReportFileFormat::PDF);
    srsReportRun.printDestinationSettings().overwriteFile(true);
    srsReportRun.printDestinationSettings().fileName(@&quot;C:\InventOnHandReport.pdf&quot;);

    if( srsReportRun )
    {
        srsReportRun.executeReport();
    }
    info(&quot;Report Saved&quot;);
}

Thanks In Advance.]]></description>
			<content:encoded><![CDATA[<p>Hi Martin,</p>
<p>I already done some similar kind of example. But in my case i am testing this through Job. Where i can set the report parameters (can take the parameter reference from VS ex:DatesetName_Parametername)in job. But how to use the dynamics parameters in X++ code. example code: This is working fine but i am unable to override default parameters added in query range(say itemid), its taking what is there in report run dailog</p>
<p>static void GenerateSSRSansSave(Args _args)<br />
{<br />
    SrsReportRun srsReportRun;<br />
    //SysMailer mailer = new SysMailer();</p>
<p>    srsReportRun = new SrsReportRun(&#8220;ReportName.Report1&#8221;);</p>
<p>    srsReportRun.init();<br />
    srsReportRun.reportCaption(&#8220;InventOnHand&#8221;);<br />
    srsReportRun.reportParameter(&#8220;InventOnHandBGDS_ViewConfigId&#8221;).value(true);<br />
    .<br />
    .<br />
    .    </p>
<p>    srsReportRun.showDialog(false);</p>
<p>    // Print to a file named ReportExample in HTML/PDF format.<br />
    srsReportRun.printDestinationSettings().printMediumType(SRSPrintMediumType::File);<br />
    srsReportRun.printDestinationSettings().fileFormat(SRSReportFileFormat::PDF);<br />
    srsReportRun.printDestinationSettings().overwriteFile(true);<br />
    srsReportRun.printDestinationSettings().fileName(@&#8221;C:\InventOnHandReport.pdf&#8221;);</p>
<p>    if( srsReportRun )<br />
    {<br />
        srsReportRun.executeReport();<br />
    }<br />
    info(&#8220;Report Saved&#8221;);<br />
}</p>
<p>Thanks In Advance.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
