Monday, January 22, 2007

How to use Site Groups as audiences in Shared Services

SSP's can only target Active Directory lists or Security Groups. Ben Curry shows in his blog,
how to use even use Site Groups as audiences in Shared Services ...
See more here..

Sunday, January 21, 2007

Adding data to Sharepoint Lists in bulk from database, Excel files

Many a times, it is required to import data in sharpoint lists from sources like SQL Server, Access db
or Excel files.
Here I will outline the steps required to import data in list from these sources. We can even link a sharepoint
list to SQL database, so that updates made to one are relfected in other and vice versa.
This is achieved through linked table feature.
  • Lets fire up Access 2007 and create a new blank access database.

  • Go to External data ribbon and we will choose ODBC to link this table to the SQL Server database.

  • Choose link to data source by creating a linked table

  • Choose a DSN for your data source or create a new one.

  • Once you get the table into Access 2007, right click the table and Choose Export -> Sharepoint List

  • Specify the address of sharepoint site and the name of the list you want to create and you are done :)

  • Sharepoint will itself create the site columns and select the data types for these columns based on the data types specified in the table.
Here we have imported the data into list from SQL server database. This can be extended to XML files, Excel files or even the Access database , paradox or even the Lotus database :)
Not to mention, just like import, you can export the data from sharepoint list to Access, SQL Server etc.....

Errors syncing SharePoint 2007 lists with Outlook 2007

I used to get a very frequent error whenever I got my document library offline to
Outlook 2007.
Task 'SharePoint' reported error (0x8000FFFF) : 'An error occurred either in
Outlook or SharePoint. Contact the SharePoint site administrator.'
or
'Outlook cannot connect to Windows Sharpoint Services site.'
If anyone is facing similar error, try doing NET STOP SENS at the command prompt.
This stops the System Event Notification Service.
After stopping this service, all connections to offline calendars, document libraries
started working fine.
Although I am yet to determine the reason for this :)

Saturday, December 23, 2006

Opening Infopath forms in Browser directly from a link

Many people have faced the problem of not been able to open Infopath form in browser in

MOSS 2007 directly from a link to .xsn file other than Form library itself. If the user tries to open an

.xsn file from the form library which is configured to render the form in the browser, the user

gets a open/save dialog box instead of a form being rendered in browser.

This is because the links clicked inside a form library or document library behave differently

than the link to same target clicked on any other page. An Office compatible client like Word 2007,

Excel 2007, InfoPath 2007 is smart enough to detect that the link is opened from Document library and

when it detects such a link click, it automatically opens the document directly from the document library

without showing the open/save dialog box in the browser. If you try to modify the document, the

document will be saved directly to the document library. This behavior of document library is identical

to that of normal Windows folder.

The solution to this problem is to have a link to URL (when the form is rendered in browser) rather

than having link to xsn file itself.

This solution is not suitable if you have a link coming in dynamically for ex. for each form in form library,

there is a link in your custom webpart. However you can easily avoid this problem by writing a simple

code which will incorporate the filename of your form in the URL.

Cannot find Data Connection Library in WSS v3

If you are wondering, when you go to create page in your sharepoint site and cannot see

Data Connection Library option there, most likely, you do not have MOSS 2007 installed.

Data Connection Library is a document library which lets you hold you data connections like

Office Data connection files which hold connection string pointing to your external data.

This feature is only available in MOSS 2007. If you are using WSS v3 only, you are out of luck J

If you have MOSS 2007 installed and still there is no option of creating Data Connection Library, you
are most probably using a team site template. Data connection library is not activated as a feature in team site.

So better solution would be to create site out of Publishing Portal or Collaboration Portal.

Wednesday, November 29, 2006

Determining the Current User Context inside Sharepoint
 
What's the best way to determine the current user within a custom web part
developed for MOSS 2007?  I've found four solutions so far, but I'm pretty sure
there are more:

1. Use System.Web.HttpContext.Current.User.Identity.Name, like in any 
    ASP.Net web application


2. Use System.Security.Principal.WindowsIdentity.GetCurrent().Name


3. Have the Current User Filter send the current user to your web part,
    and (of course) make your web part a consumer of that value.

4. SPWeb web = SPControl.GetContextWeb(Context); 
    SPUser currentUser = web.CurrentUser;

Monday, November 27, 2006

Resolving : Server is either too busy or not responding in SQL Server 2005 Analysis Services
 
I recently faced this error while connecting to Microsoft SQL Server 2005 Analysis services from Microsoft
Excel 2007. Inspite of the several solutions given on various sites none of them seemed to work.
 
The solution was simple, you need to install Microsoft OLE DB Driver 9.0 for SQL 2005, old 8.0 drivers
doesnt work.
 
To install the driver go to this page :
 
and choose the appropriate download. Note that the download needs to be installed for every client access machine.