<?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 get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/109136.aspx</link><pubDate>Thu, 12 Jan 2017 15:48:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:109136</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/109136.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=109136</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Oh man - that hadn&amp;#39;t even occurred to me. Usually when I&amp;#39;m extracting form files I need to modify them and pack them back up. :)&lt;/p&gt;&lt;p&gt;So - for using wingdings (or other symbol font) - I&amp;#39;ve attached a simple sample.&amp;nbsp;This approach combined with ExportFormat.Pdf has been working OK for my project, with the caveat that on different user machines (with different versions of IP) we have sometimes seen different results - mainly related to page sizing, margins, printable area, etc. So be sure to check that if you have different versions of InfoPath floating around. Save the file locally, right click &amp;amp; select design to open in design mode, then preview.&lt;/p&gt;</description></item><item><title>Re: How to get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/109131.aspx</link><pubDate>Thu, 12 Jan 2017 07:59:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:109131</guid><dc:creator>hansebs</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/109131.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=109131</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Amazingly, I found a simple way to get a file out of the .xsn package!&lt;/p&gt;&lt;p&gt;There&amp;#39;s actually a function in the object model&amp;nbsp;to do it:&lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;this.Template.OpenFileFromPackage(fileName)&lt;/strong&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;There&amp;#39;s a good example here:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;a href="http://theressomethingaboutsharepoint.blogspot.no/2013/01/infopath-managed-code-c-to-convert-view.html"&gt;http://theressomethingaboutsharepoint.blogspot.no/2013/01/infopath-managed-code-c-to-convert-view.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;When it comes to the problems I&amp;#39;m having with the rendering, I&amp;#39;ll probably come full&amp;nbsp;circle and try to make&amp;nbsp;&amp;nbsp;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;&lt;font color="#0000ff" face="Consolas" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;.CurrentView.Export(&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;&lt;font color="#a31515" face="Consolas" size="2"&gt;@&amp;quot;Export.pdf&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;, &lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;&lt;font color="#2b91af" face="Consolas" size="2"&gt;ExportFormat&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas" size="2"&gt;&lt;font face="Consolas" size="2"&gt;.Pdf) &lt;font face="Arial"&gt;work&lt;/font&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;It&amp;#39;s unbelievable fickle though, with borders disappearing if the width or height&amp;nbsp;is somehow off (or maybe it&amp;#39;s the weather or cosmic radiation that&amp;#39;s the culprit... :) )&amp;nbsp;If anyone have any guidelines on that, I&amp;#39;ll be happy to read it...&lt;/p&gt;&lt;p&gt;Hilary, could you show me how you did that conditional thing with replacing checkboxes with Wingdings?&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/109106.aspx</link><pubDate>Tue, 10 Jan 2017 15:52:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:109106</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/109106.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=109106</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Please do post back &amp;amp; let us know how that goes as far as proper rendering.&lt;/p&gt;&lt;p&gt;Here&amp;#39;s some sample code for using&amp;nbsp;the compression lib (which I just snagged directly from another project, so solutionPath is a variable passed into the method, but this should give you the general idea):&lt;/p&gt;&lt;blockquote style="margin-right:0px;" dir="ltr"&gt;&lt;p&gt;string tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());&lt;br /&gt;DirectoryInfo dir = Directory.CreateDirectory(tempFolder);&lt;/p&gt;&lt;p&gt;string newFileName = Path.GetRandomFileName() + &amp;quot;.cab&amp;quot;;&lt;/p&gt;&lt;p&gt;//copy to rename .xsn to .cab&lt;br /&gt;//will need cab location for repacking&lt;br /&gt;CabLocation = Path.Combine(tempFolder, newFileName);&lt;br /&gt;File.Copy(solutionPath, CabLocation);&lt;/p&gt;&lt;p&gt;CabInfo cab = new CabInfo(CabLocation);&lt;/p&gt;&lt;p&gt;//add folder to unpack to&lt;br /&gt;string destFolder = Path.Combine(tempFolder, Path.GetRandomFileName());&lt;br /&gt;Directory.CreateDirectory(destFolder);&lt;/p&gt;&lt;p&gt;cab.Unpack(destFolder);&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: How to get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/109103.aspx</link><pubDate>Tue, 10 Jan 2017 07:39:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:109103</guid><dc:creator>hansebs</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/109103.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=109103</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;No, I meant I had already tried the Word technique earlier!&lt;/p&gt;&lt;p&gt;I&amp;#39;ll try using ..Compression.Cab... I saw an article on how to do that a while back.&lt;/p&gt;&lt;p&gt;I&amp;#39;m now trying to produce the pdf with the combination of PdfSharp and HtmlRenderer. I&amp;#39;ll let anyone interested know how it goes...&lt;/p&gt;&lt;p&gt;//Hans Erik&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/109021.aspx</link><pubDate>Tue, 03 Jan 2017 15:38:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:109021</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/109021.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=109021</wfw:commentRss><description>Euw, sorry about the mislead on the Word Automation, and thanks for letting me know that it isn&amp;#39;t supported in O365. You can use Microsoft.Deployment.Compression.Cab to extract the source files programmatically. I don&amp;#39;t believe the InfoPath OM will give you the name of the print view - I think you&amp;#39;ll have to extract the form&amp;#39;s source files, then read the manifest to get info on the view you need, then grab the view from the extracted source files.</description></item><item><title>Re: How to get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/109017.aspx</link><pubDate>Tue, 03 Jan 2017 07:31:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:109017</guid><dc:creator>hansebs</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/109017.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=109017</wfw:commentRss><description>Thanks for your response, Hilary!

I know how to get a peek at the source files manually, but I was hoping there&amp;#39;s a way to do it programmatically, on the fly. I can get the filename for the view&amp;#39;s xsl from the manifest, but I haven&amp;#39;t been able to find a way to get to it with the Infopath object model...

The Windings technique, as you say, sounds like a high maintenance solution. I have at least a dozen forms, so I&amp;#39;d like it to be a bit simpler to maintain.

As this is SharePoint Online/Office 365, the Word Automation Services does no longer exist in SharePoint Online (https://technet.microsoft.com/en-us/library/sharepoint-online-content-service-description.aspx). 
I went a long way down that road before realizing this :(

//Hans Erik</description></item><item><title>Re: How to get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/108999.aspx</link><pubDate>Mon, 02 Jan 2017 15:55:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:108999</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/108999.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=108999</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;So - to answer how to get the XSL - if you save the form as source files, you&amp;#39;ll see the XSL in the files.&lt;/p&gt;&lt;p&gt;However, what I did recently to get checkboxes and option buttons to display&amp;nbsp;properly in my print view&amp;nbsp;was I used&amp;nbsp;chars from one of the Wingdings fonts with conditional formatting to show / hide based on what was selected. It was&amp;nbsp;a bit of a pain to set up,&amp;nbsp;and&amp;nbsp;if I make changes to the form, the maintenance burden is a bit higher.... but it does work.&lt;/p&gt;&lt;p&gt;I think you&amp;nbsp;might also be able to leverage Word Automation in SharePoint for this.... InfoPath &amp;gt; Word &amp;gt; PDF.&amp;nbsp;I know we have this &lt;a href="https://www.youtube.com/watch?v=muqMrUpX7Tc"&gt;webinar&lt;/a&gt;, which may get you on the path there.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;</description></item><item><title>How to get the printview and the XSLT file for it?</title><link>https://www.infopathdev.com:443/forums/thread/108994.aspx</link><pubDate>Mon, 02 Jan 2017 14:57:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:108994</guid><dc:creator>hansebs</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/108994.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=108994</wfw:commentRss><description>&lt;p&gt;Hi!&lt;/p&gt;&lt;p&gt;I&amp;#39;d like to be able to automate converting an InfoPath Filler form (with checkboxes)&amp;nbsp;to PDF, without the user having to do anything. The forms are located in SharePoint Online library.&lt;/p&gt;&lt;p&gt;As Export to pdf doesn&amp;#39;t work with checkboxes, I thought about&amp;nbsp;using&amp;nbsp;the PrintDocument class (C#)&amp;nbsp;and printing to the &amp;quot;Microsoft Print to PDF&amp;quot; printerdriver. The reason for using PrintDocument is to be able to set the filename in the code. So what I need to do is convert the xml to PrintDocument, but the problem lies with getting hold of the xsl file to get the transformation correct.&lt;/p&gt;&lt;p&gt;So the question is: how can I get&amp;nbsp;the view that is set as the print view, and the corresponding&amp;nbsp;xsl for that view?&lt;/p&gt;&lt;p&gt;Of course, I&amp;#39;ll also listen to alternate ways to do this.&amp;nbsp;:)&lt;/p&gt;&lt;p&gt;Thanks!&amp;nbsp;&lt;/p&gt;&lt;p&gt;Kind Regards,&lt;/p&gt;&lt;p&gt;Hans Erik Storeide&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>