Monday, August 13, 2012

Method 'Post' of object 'IOWSPostData' Failed in Sharepoint 2010

original source:http://makingspwork.blogspot.com/2010/04/method-post-of-object-iowspostdata.html

I'm running Sharepoint 2010 and Office 2007. I confirmed this error message does not occur if you're running Sharepoint 2010 and Office 2010, only when the environments are mixed.


All of the posts I'd read about this problem suggested editing the Excel Add-in file EXPTOOWS.XLA located in the \Program Files\Microsoft Office\Office 12\1033 folder. But editing that file didn't help me a bit. Turned out there's another version of that same file in \Program Files\Microsoft Office\Office14\1033, and that was the one that needed editing in my case.
*note: I personally modify both files from 2 folder location.
1. \office12\1033
2. \office14\1033

Before you begin, a few notes for the uninitiated:

  • EXPTOOWS.XLA is a hidden file. In order to find it, you'll have to show all hidden files on the system. Do this through the Control Panel, Appearance and Personalization, Folder Options, Show Hidden Files and Folders.
  • The 1033 folder is read-only, so you 1) must be an administrator to write to the folder and 2) can't just edit the file and save it back to the same directory.
To modify the file:1. Once you've found the file, rename it to OldEXPTOOWS.XLA (this will give you a backup in case something happens). You may be prompted to confirm the change because this is a read-only folder.

2. Double-click on OldEXPTOOWS.XLA. This will open Excel but it will look like nothing else is happening. On your keyboard, press ALT-F11 to open the built-in Visual Basic editor. It will look something like this:

*Note: If you are using 64-bit Windows, the XLA file is actually under: C:\Program Files (x86)\Microsoft Office\Office12\1033\. If you are running Windows Vista, you will need to run Excel as administrator in order to save the modified file back.

3. Open the code window and scroll until you find this section:

Sub Initialize(List, Title, URL, QuickLaunch)
strQuickLaunch = QuickLaunch
aTarget(iPublishURL) = URL
aTarget(iPublishListName) = List
aTarget(iPublishListDesc) = Title
lVer = -1 ' can't tell STS server version
If Val(Application.Version) >= 12 Then
lVer = Application.SharePointVersion(URL)
End If
End Sub


4. Comment out this line lVer = Application.SharePointVersion(URL) by adding a single apostrophe ( ' )to the beginning of the line.

5. Add a line immediately beneath the commented line that reads lVer = 2 (that's an L, as in lollipop). The section will now look like this (I have highlighted the changes):

Sub Initialize(List, Title, URL, QuickLaunch)
strQuickLaunch = QuickLaunch
aTarget(iPublishURL) = URL
aTarget(iPublishListName) = List
aTarget(iPublishListDesc) = Title
lVer = -1 ' can't tell STS server version
If Val(Application.Version) >= 12 Then
' lVer = Application.SharePointVersion(URL)
lVer = 2
End If
End Sub

image


6. Click File, Save. You will get an error message that the file is Read Only. Click OK to continue. A Save As dialog will appear. Change the file type to Excel Add-in (.xla). When you do this, the file location will change to the Excel addin directory - you will want to save the file to somewhere you can remember (like the Desktop). Make sure you've named it EXPTOOWS.XLA.

7. Close the VB editor and exit Excel.

8. Using Windows Explorer, navigate to \Program Files\Microsoft Office\Office14\1033.

9. Copy the new file (EXPTOOWS.XLA) from your Desktop (or wherever you saved it) into \Office14\1033. You will be prompted to confirm this action.

When the new file is in the \Office14\1033 folder, you should be able to import the spreadsheet into Sharepoint 2010 (although you may have to restart IE or the Sharepoint session).
Some of the blog posts say that you can change the version in the line from lVer = 2 to lVer = 3 and try that too. In my tests, it didn't matter which version you used as long as it was in the version in the \Office14\1033 directory. A modified EXPTOOWS.XLA in the \Office12\1033 folder didn't seem to cause this any ill-effects either.

Sunday, August 5, 2012

Create a customize auto numbering from SharePoint.

Original post from Autonumber Custom List Field
here are the flow:
1. Create a list name "Running Serial" with 2 columns named LastNo and NextNo.
2. Add the list column which hold the auto running number. CIN or RefNo or CustomerNo.
1. Create a workflow variable named "mNumber" or any name preferred.
2. Create a Set workflow variable action with set NextNo from "Running Serial" as a data source. Set Title from "Running Serial" as desire column name (CIN, RefNo or CustomerNo).
3. Create another action with Set field in current item. Choose the auto running number field (CIN or RefNo or CustomerNo). Set value to workflow variable, mNumber.
4. Create a last aciton with Update list item. 
5. Update "Running Serial" LastNo field with mNumber variable.
6. Set Find the list item with "Title" field, set value as "CIN" or "RefNo" or "CustomerNo".
7. Save and publish it.

Saturday, August 4, 2012

Create a public announcement and display to any other sbusite

source from Displaying a SharePoint List from another team site in Sharepoint Foundation 2010
note: SOAP Service is created on each subsite and refer to home site for the list view id.

Create a lookup list from a home site across multiple subsite.

how to allow a list collection to be a lookup to other subsite?
by doing so it eventually reduce the data duplication. For example, if you have a supplier contact, and you want to be a lookup for each subsite.

Create a lookup list from Home site.
1. create the list at your home site.
2. go to Site Actions -> Site Settings.
3. Under Galleries -> Site Columns
4. click on Create
5. give a column name.
6. Click on Lookup(Information already on this site)
7. Under Group section, you use existing group name or create a new group name. E.g: "Home Lookup Group".
8. As usual, create your lookup list refer from list collection and columns.

Setup a lookup list from existing site column.
1. Create a new content in any type or from existing content type.
2. Create lookup column with "Add from existing site columns".
3. Choose from the group you created.
4. click the "Add >" button from "Available site columns" to Columns to add".
5. Click OK to save.

SharePoint Date time format for Web Application Site

Default date time format for each site collection is English(United State). Which means the format is mm/dd/yyyy. To Have your site for different format e,g: dd/mm/yyyy, follow steps bellow:
1. Go to Site Actions -> Site Settings
2. Under Site Administration -> Regional Settings.
3. Change your Locale to English(United Kingdom).
4. Save it.

Open files in application or web browser from SharePoint

Note: This only work with Libraries type. Not List or custom list attachment.

For every document libraries, If you want to have your document being open from native application or web browser, here are the steps:
1. from the Ribbon, go to Libraries -> Libraries Settings.
2. Click on Advanced Settings
3. look for a section call Opening Documents in the Browser.
4. Choose Open in the client application OR Open in the browser.
5. save it.

Also make sure enable Permissive form Browser File Handling under Web Application General Setting from the Sharepoint Admin Central.

Tuesday, June 26, 2012

Configure SPF with RBS(Remote Blob Storage)/Store file externally

Configure your First Web Application for RBS

By Default SharePoint 2010 Foundation/Server store attachment files within the database call Blob type unlike WSS3.0, which it store file external automatically. But Luckly, there are solution from Microsoft that can have the blob type to be a remote blob, means the file can be store external from your physical HDD like WSS3.0.
This article describe by assuming you had all your SP/SPF2010 installed properly or even in a production environment.

bellow are the steps:
This is about how to configure your SPF to store files/Attachment external other than inside Database
1. go to Server installed with SQL/SQL Express.
2. launch SQL Server Configuration Manager.
3. Go the database instance, right click and choose Properties.
4. Go to Filestream Tab and check all the check box, apply and closed.



Some article mentioned that there are user who face problem of installing RBS, to solve it, simply enable pipe line from SQL Server Network Configuration.












5. Now Access to SQL Server Management Studio, access the script bellow by creating a new query:

EXEC sp_configure filestream_access_level, 2
RECONFIGURE

6. Now, choose your database. Then run the script shows bellow:

use [WSS_TEST]
if not exists 
(select * from sys.symmetric_keys 
where name = N'##MS_DatabaseMasterKey##')
create master key encryption by password = N'Admin Key Password !2#4'

where WSS_Content is your SPF Database(when you create a new SPF web application).
In my case, i use WSS_TEST.
Note: The password i rather use default as given from microsoft technet article:
http://technet.microsoft.com/en-us/library/ee748631.aspx


7. After the script above successfully execute, go to your SPF web application database and run the following script:

use [WSS_Content]
if not exists 
(select groupname from sysfilegroups 
where groupname=N'RBSFilestreamProvider')
alter database [WSS_Content]
add filegroup RBSFilestreamProvider contains filestream

Just like before, rename WSS_Content to SPF web application database.

8. Then execute the last script from bellow:

use [WSS_Content] 
alter database [WSS_Content]
 add file (name = RBSFilestreamFile, filename = 
'c:\Blobstore') 
to filegroup RBSFilestreamProvider

The default external storage location was define at C:\Blobstore folder. This folder must not physically exist otherwise the script will cause error.
You can allocate it to a different storage. For my case, i rather use different folder for different web application. here i choose D:\WSS_TEST_Blobstore
Note: In case any changes to blostore location, you can reprovision by remove, then apply the script above.
to remove use sql query:


ALTER DATABASE databasename REMOVE FILE RBSFilestreamFile


where databasename is the name of the web application.


9. Download RBS client installer from:
 http://go.microsoft.com/fwlink/?LinkID=188395&clcid=0x409.
OR
Microsoft SQL Server 2008 R2 Feture Pack: 
http://www.microsoft.com/en-us/download/details.aspx?id=16978


Open command prompt with administrator rights, navigate to rbs client installer download folder. for example C:\temp, install with command as bellow:

msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1


where DBNAME is the database of the SPF web application, my case is WSS_TEST, DBINSTANCE is the instance name of SQL Server. my case is "PORTAL\SQLEXPRESS". So the result would look like this:

Note: Many articles mention  DBInstanceName is the name of the sql server instance, which is either SQLSERVER or SQLEXPRESS or any name cared by the user. Infact after tested, the DBInstanceName is "ComputerName\SqlServerInstance"  as shown above.  Link bellow shows a screen cap of rbs client installation steps which also shows how the instance name to be use:
http://netindonesia.net/blogs/andriyadi/archive/2010/07/27/configure-sharepoint-2010-to-store-files-blob-to-the-file-system.aspx

msiexec /qn /lvx* rbs_install_log.txt /i RBS.msi TRUSTSERVERCERTIFICATE=true FILEGROUP=PRIMARY DBNAME="WSS_TEST" DBINSTANCE="PORTAL\SQLEXPRESS" FILESTREAMFILEGROUP=RBSFilestreamProvider FILESTREAMSTORENAME=FilestreamProvider_1


For the rest of the web and application server if available,  install with command bellow to the additional web server:

siexec /qn /lvx* rbs_install_log.txt /i RBS.msi DBNAME="WSS_Content" DBINSTANCE="DBInstanceName" ADDLOCAL=Client,Docs,Maintainer,ServerScript,FilestreamClient,FilestreamServer

Like before, replace WSS_Content to your web application database, replace DBInstanceName to sql instance name ("PORTAL\SQLEXPRESS").

Notice that a log file will generate and the size of the log file is about 1.38Mb. Open it and search with the text "completed successfully". Note that if your file size is less than 1Mb, then you may have not install correctly.

10. Finally go back to SQL Server Management Studio, explore your web application database, you should see some new table generated label with "mssqlrbs_"
Note: you can perform sql query with 
select * from dbo.sysobjects where name like 'rbs%'



















10. run SPF PowerShell with admin right and execute bellow:

$cdb = Get-SPContentDatabase ContentDatabaseName
$rbss = $cdb.RemoteBlobStorageSettings
$rbss.Installed()
$rbss.Enable()
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0])
$rbss

where ContentDatabaseName is web application database name (WSS_TEST).
Note: To find out what ContentDatabaseName is, you can access to SPF Central Administration,  Application Management, Manage Content databases. Choose the desire web application.



Additional RBS for other Web Application
My sharing above only apply when you first configure your SPF for the first web application. Subsequently,  you are only require to configure your database to rbs enable with steps bellow:
1. Repeat steps 6 to 8 above to configure other web application with SQL Server Management Studio.

2. Run rbs client installer with command bellow:

msiexec /qn /i rbs.msi REMOTEBLOBENABLE=1 FILESTREAMPROVIDERENABLE=1 DBNAME="ContentDbName" FILESTREAMSTORENAME=FilestreamProvider_1 ADDLOCAL=EnableRBS,FilestreamRunScript DBINSTANCE="DBInstanceName"

Where ContentDbName is your web application database name, DBInstanceName is your SQL Instance name as i describe before, "ComputerName\SQLServerInstance"

Migrate from existing Documents/Files to RBS
1. Run SharePoint 2010 Management Shell with admin rights, execute command as bellow:

$cdb=Get-SPContentDatabase ContentDbName
$rbs=$cdb.RemoteBlobStorageSettings

Where ContentDbName is the database name of the web application

2. To List all the RBS Provider, execute:
$rbs.GetProviderNames()
 3. To set first provider to be active, execute:
$rbss.SetActiveProviderName($rbss.GetProviderNames()[0]) 
3. To migrate, execute:
 $rbs.Migrate()
4. Send a query at with "Select * from AllDocstreams where RBSID IS NOT NULL" to verify if there are records return after migrate. if none return, means files are remain at database.


Final Words
My sharing above may found similarity to other tutorial but what i describe here are those steps that really confuse me. I personally tried out and found error, try again and again until i finally made it.
all sharing above can be found from link as bellow:
http://technet.microsoft.com/en-us/library/ee748592
http://blogs.technet.com/b/pramodbalusu/archive/2011/07/09/rbs-and-sharepoint-2010.aspx