<?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>Views</title><link>https://www.infopathdev.com:443/forums/42.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: wait, then print then submit and then new record</title><link>https://www.infopathdev.com:443/forums/thread/11655.aspx</link><pubDate>Sun, 18 Feb 2007 21:11:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11655</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11655.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=11655</wfw:commentRss><description>Hi Jesse,&lt;br /&gt;Why not just define a Print view for the one you are on and have users print it manually and then click a button to submit? You can't print from a button without making your form Full Trust. That's because printing requires a greater level of security. I suppose you already know that since you are doing it in code already. :) For pausing, there should be some kind of sleep function in .NET you could use. After submit, just call query using another data connector (or the same one if you have a receive and submit DB connector). Sorry, I can't be more helpful!</description></item><item><title>wait, then print then submit and then new record</title><link>https://www.infopathdev.com:443/forums/thread/11513.aspx</link><pubDate>Sat, 17 Feb 2007 05:09:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11513</guid><dc:creator>jesse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11513.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=11513</wfw:commentRss><description>I need to create a button that will switch to a different view, then print the view. Once it prints, the form is submitted and a new record is brought up clearing the previous record so new data can be entered. I have a button that will switch views, print the current view and then submit the form. However sometimes the procedure errors out because the system is still switching views when the system tries to print. I need to have it either pause for a few seconds after the switch command or wait but can't figure out the syntax for it to wait. After the form is submitted, I can't figure out how to get it to open a new record. The submit button has the option to bring new record but can't get the code to do it. The code I am using is&lt;br /&gt;&lt;br /&gt;XDocument.View.SwitchView("Edit and print service agreement");&lt;br /&gt;	XDocument.PrintOut();&lt;br /&gt;	XDocument.Submit();&lt;br /&gt;	onAfterSubmit="OpenNew"&lt;br /&gt;&lt;br /&gt;Thanks for your help.&lt;br /&gt;&lt;br /&gt;Jesse</description></item></channel></rss>