<?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: Getting &amp;quot;view is not ready&amp;quot; error</title><link>https://www.infopathdev.com:443/forums/thread/14380.aspx</link><pubDate>Thu, 09 Mar 2006 19:23:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14380</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14380.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14380</wfw:commentRss><description>Hi, &lt;br /&gt;Yes you are right you cannot call switch view in the same method, because view does not view when you call it, it will switch after the execution of the current method. So you can probably call switch view second time in the OnSwitchView() method.&lt;br /&gt;&lt;br /&gt;Other idea is to call switch view method from the taskpnae.&lt;br /&gt;</description></item><item><title>Re: Getting &amp;quot;view is not ready&amp;quot; error</title><link>https://www.infopathdev.com:443/forums/thread/14379.aspx</link><pubDate>Thu, 09 Mar 2006 15:32:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14379</guid><dc:creator>pcolmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14379.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14379</wfw:commentRss><description>Hmmm ... it looks as if InfoPath doesn't allow/can't cope with sequential view switching:&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://www.officekb.com/Uwe/Forum.aspx/infopath/643/performing-two-SwitchViews&gt;http://www.officekb.com/Uwe/Forum.aspx/infopath/643/performing-two-SwitchViews&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Has anyone got any ideas as to how I can implement printing the way I have described?&lt;br /&gt;&lt;br /&gt;--Philip&lt;br /&gt;</description></item><item><title>Re: Getting &amp;quot;view is not ready&amp;quot; error</title><link>https://www.infopathdev.com:443/forums/thread/14378.aspx</link><pubDate>Thu, 09 Mar 2006 14:55:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14378</guid><dc:creator>pcolmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14378.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14378</wfw:commentRss><description>No, it isn't in the OnLoad code, it is in the event handler for a button.&lt;br /&gt;&lt;br /&gt;The idea is that the user click on the button to print the form. My code then checks that there aren't any validation errors, switches to the first print view, prints it, switches to the second print view, prints it and then switches back to the data view.&lt;br /&gt;&lt;br /&gt;--Philip&lt;br /&gt;</description></item><item><title>Re: Getting &amp;quot;view is not ready&amp;quot; error</title><link>https://www.infopathdev.com:443/forums/thread/14377.aspx</link><pubDate>Thu, 09 Mar 2006 13:44:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14377</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14377.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14377</wfw:commentRss><description>You might want to take a quick look at this HowTo:&lt;a target="_blank" href=http://www.infopathdev.com/howto/tips/default.aspx?i=9de539adb4e846a5900a2687debb8963&gt;http://www.infopathdev.com/howto/tips/default.aspx?i=9de539adb4e846a5900a2687debb8963&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That error usually happens when you put SwitchView code in the OnLoad event, because InfoPath has not created the views yet.&lt;br /&gt;&lt;br /&gt;Otherwise, what is the "e" object you are using?</description></item><item><title>Getting "view is not ready" error</title><link>https://www.infopathdev.com:443/forums/thread/12811.aspx</link><pubDate>Thu, 09 Mar 2006 12:23:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12811</guid><dc:creator>pcolmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12811.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12811</wfw:commentRss><description>I've got the following code:&lt;br /&gt;&lt;br /&gt;Dim current_view As String = e.XDocument.View.Name&lt;br /&gt;' Switch to the accounts version of the print view &amp; print it&lt;br /&gt;e.XDocument.View.SwitchView("PrintAccountsVersion")&lt;br /&gt;e.XDocument.PrintOut()&lt;br /&gt;' Switch to the originators version of the print view &amp; print it&lt;br /&gt;e.XDocument.View.SwitchView("PrintOriginatorsVersion")&lt;br /&gt;e.XDocument.PrintOut()&lt;br /&gt;' Now restore the previous view&lt;br /&gt;e.XDocument.View.SwitchView(current_view)&lt;br /&gt;&lt;br /&gt;On the second SwitchView, I get a "view is not ready" error. If I comment out that line and the second PrintOut call, the error occurs on the attempt to restore the original view.&lt;br /&gt;&lt;br /&gt;I'm wondering if it is because InfoPath is still processing the printing action.&lt;br /&gt;&lt;br /&gt;Any suggestions on what I can do to work around this?&lt;br /&gt;&lt;br /&gt;--Philip&lt;br /&gt;</description></item></channel></rss>