<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/74654.aspx</link><pubDate>Fri, 27 Jan 2012 12:17:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74654</guid><dc:creator>Beircheart</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/74654.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=74654</wfw:commentRss><description>&lt;p&gt;For my suggestion above to work, you need to save the form before viewing it in a Print Preview&amp;nbsp;using the link above.&lt;/p&gt;
&lt;p&gt;Assuming, the form is now saved to the library. You now need to create a data connection within your form to retrieve the data from the library where you saved the form. Retrieve the&amp;nbsp;columns from the library that will give you the filename (Probably &amp;#39;Title&amp;#39;). Also,&amp;nbsp;check &amp;#39;Include data for the active form only&amp;#39; as you are creating the data connection&lt;/p&gt;
&lt;p&gt;For now,&amp;nbsp;create a&amp;nbsp;refresh button and&amp;nbsp;add&amp;nbsp;the&amp;nbsp;necessary&amp;nbsp;rules:&lt;/p&gt;
&lt;p&gt;1. Query&amp;nbsp;your form library&amp;nbsp;data connection&lt;/p&gt;
&lt;p&gt;2. Set MyFileNameField = concat(MyLibraryDataConnection.Title, &amp;quot;.xml&amp;quot;)&lt;/p&gt;
&lt;p&gt;Once the form is saved and you hit the refresh button in your form, the file name field should have something like &amp;#39;shahripusForm.xml&amp;#39; or whatever. If so, you can then use this field in your link&amp;nbsp;instead of DocumentName&lt;/p&gt;
&lt;p&gt;One thing I should mention, I ended up reverting back to the built in Print Preview button because I had a problem the custom one. My problem was that if a user opened a previously saved form, made changes and then selected Print Preview without saving the form again, the print preview would not reflect the new changes. This was a deal breaker for me&lt;/p&gt;
&lt;p&gt;Nevertheless, in&amp;nbsp;workflows&amp;nbsp;I still find the link useful if I wanted to point someone at the print preview instead of the form itself.&lt;/p&gt;
&lt;p&gt;Now I need to get back to work! :)&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/74653.aspx</link><pubDate>Fri, 27 Jan 2012 11:42:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74653</guid><dc:creator>shahripu</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/74653.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=74653</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;hi ,i am using the standard built in save icon in the toolbar.n in my form&amp;nbsp; i have sign button for initial form to send email to user group.After sign up i have click the save built icon to save the document&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/74652.aspx</link><pubDate>Fri, 27 Jan 2012 11:35:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74652</guid><dc:creator>Beircheart</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/74652.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=74652</wfw:commentRss><description>&lt;p&gt;Are you using a custom Save button (i.e&amp;nbsp;Using Submit data connection to submit your form to the library) or are you using the standard built in save icon in the toolbar?&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/74651.aspx</link><pubDate>Fri, 27 Jan 2012 11:17:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74651</guid><dc:creator>shahripu</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/74651.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=74651</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Ben ,&lt;/p&gt;&lt;p&gt;&amp;nbsp; As you told above&amp;nbsp; i added the&amp;nbsp; field and give the name DocumentName but further how to know this field hold the file name and how to set value of this field as you did above .please give me idea step by step for this process. i have need to display the document name when published info-path form is saved on document library in SharePoint 2010&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/74650.aspx</link><pubDate>Fri, 27 Jan 2012 10:29:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74650</guid><dc:creator>Beircheart</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/74650.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=74650</wfw:commentRss><description>&lt;p&gt;Hi shahripu,&lt;/p&gt;
&lt;p&gt;In my case,&amp;nbsp;DocumentName was simply&amp;nbsp;a field I created. So DocumentName could be replaced with some field in your form that holds the file name&lt;/p&gt;
&lt;p&gt;As for what value my DocumentName field was equal to:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The first time i&amp;nbsp;save my form using a custom save button, I&amp;nbsp;set the DocumentName to concat(../../my:CurrentUserName, &amp;quot;-&amp;quot;, ../../../my:Descriptors/my:ProgrammeTitle)&amp;nbsp;and using a submit data connection, I would submit it to the library using DocumentName as a file name&lt;/p&gt;
&lt;p&gt;Does that clear things up?&lt;/p&gt;
&lt;p&gt;All the best,&lt;/p&gt;
&lt;p&gt;Ben&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/74649.aspx</link><pubDate>Fri, 27 Jan 2012 10:12:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74649</guid><dc:creator>shahripu</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/74649.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=74649</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hi ,&lt;/p&gt;&lt;p&gt;&amp;nbsp;i was using the above Formula in my info path form 2010&amp;nbsp; to display the hyperlink but how to put &lt;u&gt;&lt;b&gt;DocumentName&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;/u&gt;&lt;b&gt;in my form &lt;/b&gt;&lt;b&gt;please&lt;/b&gt;&lt;u&gt;&lt;b&gt; &lt;/b&gt;&lt;/u&gt;&lt;b&gt;give me a idea about that.&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;I created a hyperlink in my Infopath 2010 Browser based form. I then 
created a field&amp;nbsp;and set the default value as follows: 
concat(SharePointSiteUrl(), 
&amp;quot;_layouts/Print.FormServer.aspx?XmlLocation=&amp;quot;, SharePointListUrl(), 
&lt;u&gt;&lt;b&gt;DocumentName&lt;/b&gt;&lt;/u&gt;, &amp;quot;xml?OpenIn=Browser&amp;quot;)&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/69877.aspx</link><pubDate>Wed, 31 Aug 2011 14:13:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69877</guid><dc:creator>Beircheart</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69877.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69877</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I was also looking to create a custom &lt;strong&gt;Print Preview&lt;/strong&gt; button and I&amp;#39;d just like to post how I eventually achieved this.&lt;/p&gt;
&lt;p&gt;After much searching without much luck, I decided to examine the existing Print Preview button. I included it in my form, clicked it and viewed the properties of the pop up window. Here it showed the following URL: &lt;a href="https://%3cserver%3e/%3CSite%3E/_layouts/Print.FormServer.aspx"&gt;https://&amp;lt;Server&amp;gt;/&amp;lt;Site&amp;gt;/_layouts/Print.FormServer.aspx&lt;/a&gt;. I then looked for a suitable parameter to pass to it and found that the following works: &lt;a href="https://%3cserver%3e/%3CSite%3E/_layouts/Print.FormServer.aspx?XmlLocation=https:"&gt;///MyTestForm.xml?OpenIn=Browser&amp;quot;&amp;gt;https://&amp;lt;Server&amp;gt;/&amp;lt;Site&amp;gt;/_layouts/Print.FormServer.aspx?XmlLocation=https://&amp;lt;Server&amp;gt;/&amp;lt;Site&amp;gt;/&amp;lt;List&amp;gt;/MyTestForm.xml?OpenIn=Browser&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I created a hyperlink in my Infopath 2010 Browser based form. I then created a field&amp;nbsp;and set the default value as follows: concat(SharePointSiteUrl(), &amp;quot;_layouts/Print.FormServer.aspx?XmlLocation=&amp;quot;, SharePointListUrl(), DocumentName, &amp;quot;xml?OpenIn=Browser&amp;quot;)&lt;/p&gt;
&lt;p&gt;I then created a hyperlink with the value of that field and it works well for me&lt;/p&gt;
&lt;p&gt;Maybe this will be of use to someone&lt;/p&gt;
&lt;p&gt;All the best,&lt;/p&gt;
&lt;p&gt;Ben&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/60982.aspx</link><pubDate>Tue, 02 Nov 2010 09:10:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60982</guid><dc:creator>princevis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60982.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60982</wfw:commentRss><description>&lt;p&gt;I had this requirement once, to print the form on button click. For this , i first created an excel template and created a form there exactly similar to Infopath form using excel VSTA, and then i took the print using excel functionality.&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/60980.aspx</link><pubDate>Tue, 02 Nov 2010 09:01:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60980</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60980.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60980</wfw:commentRss><description>&lt;p&gt;The Print() method is not available in browser forms.&amp;nbsp; I think it&amp;#39;s unlikely that InfoPath provides a way to initiate a print action from a browser form.&amp;nbsp; Your best bet is probably to switch the form to a print view and instruct the user to manually print the page.&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/60979.aspx</link><pubDate>Tue, 02 Nov 2010 05:19:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60979</guid><dc:creator>rahulbabar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60979.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60979</wfw:commentRss><description>&lt;p&gt;I verified it and its C# only.&lt;/p&gt;
&lt;p&gt;Rahul Babar&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/60915.aspx</link><pubDate>Sat, 30 Oct 2010 12:58:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60915</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60915.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60915</wfw:commentRss><description>&lt;p&gt;hi, verify your codes language is c# and not c#2003. On option, form option, programming and select c#.&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/60911.aspx</link><pubDate>Sat, 30 Oct 2010 04:22:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60911</guid><dc:creator>rahulbabar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60911.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60911</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t see print function for &amp;quot;this&amp;quot; object, am I missing something?&lt;/p&gt;
&lt;p&gt;Rahul Babar&lt;/p&gt;</description></item><item><title>Re: How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/60910.aspx</link><pubDate>Sat, 30 Oct 2010 04:09:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60910</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60910.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60910</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;hi, you can use this.print(); it requires Full Trust and publishing 
through Central Admin (publish as admin-approved).&lt;/p&gt;&lt;p&gt;Browser forms are translations of the infopath client form
 template, the formatting is 
almost never exactly the same, and some settings can change.&amp;nbsp; it&amp;#39;s really difficult to get the print view to be exactly
 the same in a browser form. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to write C# Code for custom print button?</title><link>https://www.infopathdev.com:443/forums/thread/60909.aspx</link><pubDate>Sat, 30 Oct 2010 03:29:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60909</guid><dc:creator>rahulbabar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60909.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60909</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I have added a custom print button to browser based infopath form. &lt;/p&gt;
&lt;p&gt;I want to add code behind for this button. Does anyone know the exact c# code for this? &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Rahul Babar&lt;/p&gt;</description></item></channel></rss>