<?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>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: How to automatic Switch the View  of the Form</title><link>https://www.infopathdev.com:443/forums/thread/16513.aspx</link><pubDate>Mon, 12 Feb 2007 21:08:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:16513</guid><dc:creator>JoeyL</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/16513.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=16513</wfw:commentRss><description>Has there been any development on this?  I am having a similar problem.&lt;br /&gt;&lt;br /&gt;XmlFormView1.XmlForm.ViewInfos.SwitchView("Address"); in a button click event gives an object error.</description></item><item><title>Re: How to automatic Switch the View  of the Form</title><link>https://www.infopathdev.com:443/forums/thread/16512.aspx</link><pubDate>Tue, 26 Dec 2006 05:41:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:16512</guid><dc:creator>LinFeng</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/16512.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=16512</wfw:commentRss><description>Hi Shiva,&lt;br /&gt;&lt;br /&gt;Thanks so much for your reply.&lt;br /&gt;Maybe I didn't describe the question clearly.&lt;br /&gt;I did an experiment, I created a custom aspx page using the Visual Studio and drag the XmlFormView control to the page, after that, I insert the URL of the form template, the code of this aspx page would add a line of code like this:&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;&amp;lt;cc1:xmlformview id="XmlFormView2" runat="server" editingstatus="Editing" height="250px" width="100%" xsnlocation="http://servername/formlibrary/Forms/template.xsn" OnInitialize="LoadForm"&amp;gt;&amp;lt;/cc1:xmlformview&amp;gt;&lt;/font id="red"&gt;&lt;br /&gt;&lt;br /&gt;and then, in the code behind, I add the LoadForm function, I tried to use the &lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;XmlFormView2.XmlForm.ViewInfos["ViewName"].IsDefault=true;&lt;/font id="red"&gt;&lt;br /&gt;&lt;br /&gt;to set the default view when the form is opened via browser, but, there's no "&lt;font color="red"&gt;IsDefault&lt;/font id="red"&gt;" statement provided.&lt;br /&gt;&lt;br /&gt;So, the OnLoad view switch seems not gonna work...&lt;br /&gt;&lt;br /&gt;And then, I tried the OnClick event, I add a button to the aspx page, and use the button's OnClick Event to call a function named "ChangeView" to change the view, the code is below:&lt;br /&gt;&lt;br /&gt;&lt;font color="red"&gt;protected void ChangeView(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    XmlFormView2.XmlForm.ViewInfos.SwitchView("View2");&lt;br /&gt;}&lt;/font id="red"&gt;&lt;br /&gt;&lt;br /&gt;when I debug, in the aspx page, I click the button, an NullReferenceException occur, this really puzzle me, is there anything I can do to fix these problems?&lt;br /&gt;</description></item><item><title>Re: How to automatic Switch the View  of the Form</title><link>https://www.infopathdev.com:443/forums/thread/16511.aspx</link><pubDate>Tue, 26 Dec 2006 04:44:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:16511</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/16511.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=16511</wfw:commentRss><description>Hi LinFeng,&lt;br /&gt;&lt;br /&gt;We should not use &lt;b&gt;thisXDocument.ViewInfos["My View Name"].IsDefault = true&lt;/b&gt; statement in onClick event. If we try debugging on this statement in other than onLoad event we didn#%92t get the &lt;b&gt;IsDefault&lt;/b&gt; property. We need to write this statement in onLoad event only. You can write below code in your onLoad event for your requirement.&lt;br /&gt;if(thisXDocument.IsNew)&lt;br /&gt;{&lt;br /&gt;	//Form open in first time&lt;br /&gt;thisXDocument.ViewInfos["View 1"].IsDefault = true;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;	//After submitting the form&lt;br /&gt;thisXDocument.ViewInfos["View 2"].IsDefault = true;&lt;br /&gt;&lt;br /&gt;}</description></item><item><title>Re: How to automatic Switch the View  of the Form</title><link>https://www.infopathdev.com:443/forums/thread/16510.aspx</link><pubDate>Mon, 25 Dec 2006 09:47:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:16510</guid><dc:creator>LinFeng</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/16510.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=16510</wfw:commentRss><description>&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;i&gt;Originally posted by shailaja&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Hello LinFeng and Welcome to Forums,&lt;br /&gt;   Have you gone through this tutorial&lt;a target="_blank" href=http://www.infopathdev.com/howto/tutorials/default.aspx?i=b5613773df374e42a0dddc22acb21d8e&gt;http://www.infopathdev.com/howto/tutorials/default.aspx?i=b5613773df374e42a0dddc22acb21d8e&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hi Shailaja,&lt;br /&gt;&lt;br /&gt;I'm appreciate your reply on this, yes, I have read this tutorial already before I post this question.&lt;br /&gt;I'm trying to switch the view of the InfoPath Form which opened in browser, because the aspx page use the XmlFormView control to show the InfoPath Form, so I wonder whether there is any method to switch the view.&lt;br /&gt;I also know the SwitchView method can't be use in the OnLoad event, so I did a test on this by using a button on the aspx page to call this method by the OnClick event, but when I debug this in Visual Studio,  a “NullReferenceException was unhandled by user code” exception occur, it says “Object reference not set an instance of an object”.I also tried the &lt;font color="red"&gt;thisXDocument.ViewInfos["My View Name"].IsDefault = true;&lt;/font id="red"&gt; in order to Change the Default View when the form is opened in the browser, but infact there's no "IsDefault" property provided for me to set the Default View, it still no work.&lt;br /&gt;I don't know reason for these problem and how to fix them, I really appreciate for your guys help. &lt;br /&gt;&lt;br /&gt;Thanks in advance!</description></item><item><title>Re: How to automatic Switch the View  of the Form</title><link>https://www.infopathdev.com:443/forums/thread/16509.aspx</link><pubDate>Mon, 25 Dec 2006 05:34:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:16509</guid><dc:creator>shailaja</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/16509.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=16509</wfw:commentRss><description>Hello LinFeng and Welcome to Forums,&lt;br /&gt;   Have you gone through this tutorial&lt;a target="_blank" href=http://www.infopathdev.com/howto/tutorials/default.aspx?i=b5613773df374e42a0dddc22acb21d8e&gt;http://www.infopathdev.com/howto/tutorials/default.aspx?i=b5613773df374e42a0dddc22acb21d8e&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps!</description></item><item><title>How to automatic Switch the View  of the Form</title><link>https://www.infopathdev.com:443/forums/thread/15506.aspx</link><pubDate>Sun, 24 Dec 2006 08:36:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15506</guid><dc:creator>LinFeng</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15506.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=15506</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I have a Form Template with mutiple views, one is "View 1" and the second one named "View 2", the "View 1" is my default view, and it is published to the SharePoint Server with Forms Server deployed with it. I can open the form via browser, here's my problem: the first time I opened the form, it is "View 1", but after the submition, the next time I open it, I want it switch to the "View 2", I've tried using the SwitchView method, but there seems to have some problem.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Best Regards,&lt;br /&gt;&lt;br /&gt;LinFeng</description></item></channel></rss>