Wednesday, October 15, 2008

Saving the the Repeating table Data with Webservice

Hello All,
Do u want to make the repeating table, to work like gridview ?

Follow these steps

To disable every row of the infopath and enable only after selecting each row
a)Set any textbox value as hidden control and set its default value to 0(Textbox should be inside repeating table and binding field representable for textbox should be repeating)
b)To make every control disabled inside repeating table ,you need to use the conditional formatting for every control ,selecting field of the table

now on click of the select button u neeed to change the value of hidden textbox
as follows
public void btnSelect_Clicked(object sender, ClickedEventArgs e)

//code to enable the disabled row of repeating table
XPathNavigator MainDs = MainDataSource.CreateNavigator();

XPathNavigator x1 = e.Source.SelectSingleNode("CompanyID", NamespaceManager);

MainDs.SelectSingleNode("/my:myFields/my:hidden", NamespaceManager).SetValue(x1.InnerXml.ToString());//Set the hidden field value


After updating values of selected row, saving the value to database

//Executing the webservice programaticaly
public void btnSave_Clicked(object sender, ClickedEventArgs e)

// DataConnection dn = new DataConnection();
// WebServiceConnection wb = new WebServiceConnection();
//// wb.
XPathNavigator MainDs = MainDataSource.CreateNavigator();

MainDs.SelectSingleNode("/my:myFields/my:hidden", NamespaceManager).SetValue("0");//Set the hidden field value

// Open connection.
WebServiceConnection wsc = (WebServiceConnection)this.DataConnections["SaveComp"];//Name of the webservice as dataconnection

// Create XmlDocuments.
XmlDocument inputDocument = new XmlDocument();
XmlDocument outputDocument = new XmlDocument();
XmlDocument errorsDocument = new XmlDocument();

// Load input document.
XPathNavigator x1 = e.Source.CreateNavigator();
// inputDocument.LoadXml(x1.OuterXml.ToString());
inputDocument.LoadXml(@"<SaveDepartmentsWithID xmlns='http://tempuri.org/'>" + x1.InnerXml.ToString() + "");//Name of the webmethod SaveDepartmentsWithID

// Create XPathNavigator objects for documents.
XPathNavigator inputNav = inputDocument.CreateNavigator();
XPathNavigator outputNav = outputDocument.CreateNavigator();
XPathNavigator errorsNav = errorsDocument.CreateNavigator();

// Call Execute method.
wsc.Execute(inputNav, outputNav, errorsNav);

// Write your code here.

Monday, September 22, 2008

Commandline tools for Moss Site

commandline tool for deleting SSP
stsadm -o deletessp -title -force

Thursday, September 18, 2008

Conditional sum with infopath form

Hello All
To get the conditional sum in repeating table (which acts like gridview)
as follows

1)Set the property of repeating table as given following image

Add textbox(field2) to the row of repeating table and other textbox(field4) to the footer
of table and checkbox as shown in the fig

right click on the properties of textbox-->change the default value by clicking on fx
--insert function-->select sum-> insert field-->select the field-->click on the filter button-->select the checkbox value is equal to true

as shown

Databinding of controls on load of infopath forms

Hello All,
To retrieve the data from the webservice and to populate(Databind) the data on infopath form. follow the following steps
from menu of design view of infopath form
1)Tools-->DataConnection->Add connection as webservice to retrieve the data

2)Right click on textbox which is to be binded to the field from dataset
--->Insert formula-->Insert field/group

from Data source dropdown select the name of the webservice which acts like the secondary datasource(Webservice which returns Dataset and which is hosted as virtual directory in the same webapplication)

3) bind the queryfield in dataset if the textbox acts like parameter
bind the datafield in dataset if it acts like output from the webservice

Tuesday, September 9, 2008

Running the webenabled infopath form with managed VSTA code

Hello All,

In order to publish the infopath form with managed code(VSTA)
you need to do the following tasks
1)publish the form to local location as follows

2)Go to central administration site
1)Application management-->Manage infopath template(under infopath form services)--> upload template
Here upload the template published on the local machine

2)Activate this form for the webapplication or site where u want to publish in form library or as webenabled form
Right click on the uploaded form--->Activate for the site collection

3)Browse the site or directory where the Administrator approved form is activated
Home-->view all contents-->Form template
you will find the form which is activated in central administration site

4)To configure form to publish in form library
click on Settings of form library-->Advance settings-->set the destination and url
(these values can be obtained when form is published as administrator approved form +form containing managed code)

5)Now you will get the form which can be opened as the webenabled form either in xmlformview (control to embed infopath form in aspx page with its xsn location)

Saturday, September 6, 2008

Enabling Infopath form Services for browser enabled Form

Hello All,

While publishing the infopath form on MOSS2007
you may come across following situation

To Resolve this issue you have to enable
Office SharePoint Server Enterprise Site Collection features in site collection of central administration site
as follows