Hi,
Thank you very much for the reply. Wishing you a very Happy New year
I am very new to Infopath. I have a button on the Default view page, which is called Print.
In the View toolbar available in Infopath designer, i created a new view, named it "PrintView". Added a Picture tool in it.
How to switch to the "PrintView" on the click of the button.
I tried this in the button click:
[CODE]
public void BtnPriint_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator xnDocument = this.MainDataSource.CreateNavigator();
XPathNavigator xnDefaultView = xnDocument.SelectSingleNode("/my:myFields/my:Image1", this.NamespaceManager);
//Image1 is the name of Picture tool available in the Default View
if (this.MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Image1", this.NamespaceManager).Value != string.Empty)
{
if ((xnDefaultView != null) && (xnDefaultView.Value != ""))
{
//Switch to the appropriate View
switch (xnDefaultView.Value)
{
case "false":
e.SetDefaultView("View 1");
break;
case "true":
e.SetDefaultView("PrintImageView");
//Image2 is the Name of the Picture tool available in the Newly created View
if (this.MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:Image2", this.NamespaceManager).Value != string.Empty)
{
this.Print(true);
}
break;
}
}
}
}
[/CODE]
I am getting the error as 'Microsoft.Office.InfoPath.ClickedEventArgs' does not contain a definition for 'SetDefaultView'
And, i am not sure of how to move the picture which is available in the first view to the second view.
How to achieve this?
Thank you