<?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>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Bulk print of browser-enabled forms from SharePoint page</title><link>https://www.infopathdev.com:443/forums/thread/47267.aspx</link><pubDate>Wed, 23 Sep 2009 08:51:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47267</guid><dc:creator>philljenkins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47267.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=47267</wfw:commentRss><description>&lt;p&gt;Thanks Qazi.&lt;/p&gt;
&lt;p&gt;I have debugged my code, again and again. I can&amp;#39;t find anything wrong.&lt;/p&gt;
&lt;p&gt;My code is&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;private void PrintClaim(string urlClaim)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft.Office.Interop.InfoPath.Application ipApp = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ipApp = new Microsoft.Office.Interop.InfoPath.Application();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddMessage(&amp;quot;Created InfoPath app object&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XDocument xdocClaim = ipApp.XDocuments.Open(urlClaim, (int)XdDocumentVersionMode.xdCanOpenInReadOnlyMode );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddMessage(&amp;quot;Opened claim&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xdocClaim.PrintOut();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddMessage(&amp;quot;Printed claim&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (Exception ex)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddMessage(&amp;quot;Print failed with &amp;quot; + ex.Message);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;finally&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ipApp.Quit(true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I know from the trace provided by AddMessage that it gets up to the ipApp.XDocuments.Open statement but that that never returns. &lt;/p&gt;
&lt;p&gt;I have tried different VersionMode values to no avail. Looking at Task Manager I can see the INFOPATH.EXE process that is created. If I kill that the code proceeds to catch an exception. There are no clues in the host events nor in the SharePoint logs.&lt;/p&gt;
&lt;p&gt;The url I am passing in is of the form &lt;a href="http://site/library/form.xml"&gt;http://site/library/form.xml&lt;/a&gt; (e.g. &lt;a href="http://portal.dev.envirolink.local/admin/tec/Claims/TS-pjenkins-20090907.xml"&gt;http://portal.dev.envirolink.local/admin/tec/Claims/TS-pjenkins-20090907.xml&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;If the url &amp;#39;bad&amp;#39;?&amp;nbsp;Have&amp;nbsp;I created&amp;nbsp;ipApp badly? Is there some other property of ipApp I should be setting? Should I be passing different arguments to Open? &lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;Phill&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Bulk print of browser-enabled forms from SharePoint page</title><link>https://www.infopathdev.com:443/forums/thread/47263.aspx</link><pubDate>Wed, 23 Sep 2009 08:03:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47263</guid><dc:creator>Qazi Anis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47263.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=47263</wfw:commentRss><description>&lt;p&gt;infopath app can open broswer enabled forms. so there must be some other thing that is going wrong. just debug your code and see what is going wrong&lt;/p&gt;</description></item><item><title>Bulk print of browser-enabled forms from SharePoint page</title><link>https://www.infopathdev.com:443/forums/thread/47241.aspx</link><pubDate>Tue, 22 Sep 2009 15:35:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:47241</guid><dc:creator>philljenkins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/47241.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=47241</wfw:commentRss><description>&lt;p&gt;I have Sharepoint 2007 with&amp;nbsp;a list of browser-enabled infopath&amp;nbsp;forms. I have an aspx page which enables the user to select a date range. When the user clicks a &amp;#39;Print&amp;#39; button on the page the code behind can process the list of forms, and find all forms for which the form date (a field in the form) lies within the selected date range. Now I want the code to print the found forms. And that&amp;#39;s where I come unstuck. I tried code like the following (where urlClaim is a url to the form .xml)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft.Office.Interop.InfoPath.Application ipApp = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ipApp = new Microsoft.Office.Interop.InfoPath.Application();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XDocument myXDoc = ipApp.XDocuments.Open(urlClaim,(int)XdDocumentVersionMode.xdFailOnVersionOlder);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myXDoc.PrintOut();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch (Exception ex)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddMessage(&amp;quot;Print failed with &amp;quot; + ex.Message);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Unfortunately the call on Open never returns. But after some thinking I realise that perhaps the InfoPath app can&amp;#39;t open&amp;nbsp;the browser enabled form. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;So, assuming that using the&amp;nbsp;InfoPath app is the wrong answer,&amp;nbsp;how do I print a browser-enabled form from code?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>