Friday, August 14, 2009
infopath form quick note
Note: When a form has a dropdown from a reference list in SharePoint, changing the values of the reference list does NOT change the selected values in the existing forms....which is an excellent thing.
SSRS integration with MOSS notes
Some quick notes on integrating SSRS with MOSS. Using Sql 2005 SP2.
1. Configure Report Services BEFORE installing the add-in.
2. Must use the Reporting Services Configuration tool in Sql to configure the virtual directory. DO NOT use IIS.
3. If don't see the Reporting Services section in CA after installing the add-in, check and see if the Reporting Services site collection feature is enabled in the CA. Must login as a site collection admin for the CA to see this section.
1. Configure Report Services BEFORE installing the add-in.
2. Must use the Reporting Services Configuration tool in Sql to configure the virtual directory. DO NOT use IIS.
3. If don't see the Reporting Services section in CA after installing the add-in, check and see if the Reporting Services site collection feature is enabled in the CA. Must login as a site collection admin for the CA to see this section.
Thursday, April 30, 2009
Cannot delete content type from list
Problem: Added in a content type to a list and it's not letting me delete it. Says content type in use.
Soln: Modify the view of the list and see which item is using the content type. (Check the 'content type' column to have it in the view.) Then change the content type to some other one (perhaps 'Document'). After all the items are changed to a different content type, you can then delete the one that says in use.
Soln: Modify the view of the list and see which item is using the content type. (Check the 'content type' column to have it in the view.) Then change the content type to some other one (perhaps 'Document'). After all the items are changed to a different content type, you can then delete the one that says in use.
Friday, April 3, 2009
Alerts setup findings
For users to see their own alerts on "My Settings", they must have at least READ access.
With READ access, they see the "alert me", but when they click on "alert me", it gives "access denied".
With anonymous access turned on, everyone can read. However, if user is not in read access category, user will NOT get the alert.
With READ access, they see the "alert me", but when they click on "alert me", it gives "access denied".
With anonymous access turned on, everyone can read. However, if user is not in read access category, user will NOT get the alert.
Tuesday, March 24, 2009
Generate Unique ID for InfoPath form
We are going to generate a Unique ID for each InfoPath form using a SharePoint list. We will then use this ID as the unique filename.
1. Create a SharePoint list with a key column:
2. Each time we load the InfoPath form, we will grab the key and then increment the key by 1:
XPathNavigator xNav = MainDataSource.CreateNavigator();
XPathNavigator nodeTermid = xNav.SelectSingleNode("my:myFields/my:TermID",
NamespaceManager);
if (nodeTermid.InnerXml == "0")
{
string termid = getTermID();
nodeTermid.SetValue(termid);
….
}
private string getTermID()
{
string termSite = ConfigurationManager.AppSettings["url_termsite"].ToString();
string termIDListName = ConfigurationManager.AppSettings["list_termid"].ToString();
string termIDKey = string.Empty;
SPSite mysite = null;
SPWeb site = null;
try
{
mysite = new SPSite(termSite);
site = mysite.RootWeb;
site.AllowUnsafeUpdates = true;
SPList list = site.Lists[termIDListName];
SPQuery query = new SPQuery();
string queryText = "<Where><Eq><FieldRef Name='{0}'" +
"/><Value Type='Text'>{1}</Value></Eq></Where>";
queryText = string.Format(queryText, "Title", "termid");
query.Query = queryText;
SPListItemCollection results = list.GetItems(query);
foreach (SPListItem item in results)
{
termIDKey = item["key"].ToString();
}
int newID = Convert.ToInt32(termIDKey) + 1;
UpdateFieldValues(termIDListName, "key", newID.ToString(), "Title", "termid");
return termIDKey;
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (mysite != null) mysite.Dispose();
if (site != null) site.Dispose();
}
}
public static void UpdateFieldValues(string listName, string attribute, string attrValue,
string filterField, string filterValue)
{
SPSite mysite = null;
SPWeb site = null;
try
{
mysite = new SPSite(ConfigurationManager.AppSettings["url_termsite"].ToString());
site = mysite.RootWeb;
site.AllowUnsafeUpdates = true;
SPList list = site.Lists[listName];
SPQuery query = new SPQuery();
string queryText = "<Where><Eq><FieldRef Name='{0}'" +
"/><Value Type='Text'>{1}</Value></Eq></Where>";
queryText = string.Format(queryText, filterField, filterValue);
query.Query = queryText;
SPListItemCollection results = list.GetItems(query);
foreach (SPListItem item in results)
{
item[attribute] = attrValue;
item.UpdateOverwriteVersion();
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (mysite != null) mysite.Dispose();
if (site != null) site.Dispose();
}
}
1. Create a SharePoint list with a key column:
2. Each time we load the InfoPath form, we will grab the key and then increment the key by 1:
XPathNavigator xNav = MainDataSource.CreateNavigator();
XPathNavigator nodeTermid = xNav.SelectSingleNode("my:myFields/my:TermID",
NamespaceManager);
if (nodeTermid.InnerXml == "0")
{
string termid = getTermID();
nodeTermid.SetValue(termid);
….
}
private string getTermID()
{
string termSite = ConfigurationManager.AppSettings["url_termsite"].ToString();
string termIDListName = ConfigurationManager.AppSettings["list_termid"].ToString();
string termIDKey = string.Empty;
SPSite mysite = null;
SPWeb site = null;
try
{
mysite = new SPSite(termSite);
site = mysite.RootWeb;
site.AllowUnsafeUpdates = true;
SPList list = site.Lists[termIDListName];
SPQuery query = new SPQuery();
string queryText = "<Where><Eq><FieldRef Name='{0}'" +
"/><Value Type='Text'>{1}</Value></Eq></Where>";
queryText = string.Format(queryText, "Title", "termid");
query.Query = queryText;
SPListItemCollection results = list.GetItems(query);
foreach (SPListItem item in results)
{
termIDKey = item["key"].ToString();
}
int newID = Convert.ToInt32(termIDKey) + 1;
UpdateFieldValues(termIDListName, "key", newID.ToString(), "Title", "termid");
return termIDKey;
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (mysite != null) mysite.Dispose();
if (site != null) site.Dispose();
}
}
public static void UpdateFieldValues(string listName, string attribute, string attrValue,
string filterField, string filterValue)
{
SPSite mysite = null;
SPWeb site = null;
try
{
mysite = new SPSite(ConfigurationManager.AppSettings["url_termsite"].ToString());
site = mysite.RootWeb;
site.AllowUnsafeUpdates = true;
SPList list = site.Lists[listName];
SPQuery query = new SPQuery();
string queryText = "<Where><Eq><FieldRef Name='{0}'" +
"/><Value Type='Text'>{1}</Value></Eq></Where>";
queryText = string.Format(queryText, filterField, filterValue);
query.Query = queryText;
SPListItemCollection results = list.GetItems(query);
foreach (SPListItem item in results)
{
item[attribute] = attrValue;
item.UpdateOverwriteVersion();
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (mysite != null) mysite.Dispose();
if (site != null) site.Dispose();
}
}
Labels:
.NET,
InfoPath Forms Services 2007,
SharePoint 2007
Tuesday, February 10, 2009
Outlook 2007 not rendering external/internet images
Ran into this problem when working on Alerts for blog sites. The alert renders images that are stored in the intranet, but not from internet sites.
Solution: As suspected, it was my Outlook 2007 settings. To fix, go to Tools -> Trust Center
UNCHECK the "Don't download pictures automatically in HTML e-mail messages or RSS Items"
Solution: As suspected, it was my Outlook 2007 settings. To fix, go to Tools -> Trust Center
UNCHECK the "Don't download pictures automatically in HTML e-mail messages or RSS Items"
Switching application pools, site not rendering correctly
This is an easy one, but might take some people sometime to figure out.
Problem: The admin run into an problem today when switching an application pool for a site. The site was not rendered correctly once switched to the new application pool and with the old one stopped. Upon taking a look, all the images were not showing.
Solution: Make sure the 'images', along with all other applications (virtural directories) are using the same app pool. In this case, the new app pool.
Problem: The admin run into an problem today when switching an application pool for a site. The site was not rendered correctly once switched to the new application pool and with the old one stopped. Upon taking a look, all the images were not showing.
Solution: Make sure the 'images', along with all other applications (virtural directories) are using the same app pool. In this case, the new app pool.
Thursday, February 5, 2009
Don't see the style library in the newly created team site
Subscribe to:
Posts (Atom)