Wednesday, February 29, 2012

Export Farm Solution Package with PowerShell

Follow the steps below to export a farm solution package…

1. Open a text editor – such as Notepad.
2. Paste the following code snippet:

$farm = Get-SPFarm
$file = $farm.Solutions.Item("MySolutionPackage.wsp").SolutionFile
$file.SaveAs("c:\MySolutionPackage.wsp")

3. Replace the highlighted text above with the name of your solution package.
4. Save the file - give the file a name and save it with the extension ps1 (eg. extract.ps1) and place the file on the C:\ drive.
5. Open the SharePoint 2010 Management Shell
6. Navigate to the location of the script and execute it.
7. The solution package will be available on the C:\ drive

Thursday, February 16, 2012

Error: The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service...

This error can be encountered while viewing an InfoPath form in the browser. In most cases, the problem can be solved by reading through the following blogpost.

In my case, the state service was enabled and the service application was correctly associated with the webapplication. I solved this by deleting the 'corrupt' state service database, creating a new one and attaching the new database to the farm - all these steps can be done with some Powershell commands.


Friday, September 9, 2011

Reserved Querystring Parameters In SharePoint

This is probably the 100th post on the net about...
"Be careful when naming querystring parameters in your SharePoint applications"

But you can't say it enough. They cause trouble!
For more info read this.

Wednesday, September 7, 2011

Could not access the Search administration database. A generic error occurred while trying to access the database to obtain the schema version info.

Deleting the following registry key - did the trick for me:

“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\Services\Microsoft.SharePoint.Search.Administration.SPSearchService”

In fact, it's just one of the things that need to be verified.
Read this post for more info.

Saturday, June 11, 2011

Default location picture upload in RTE

If you want to insert a picture in the rich text editor directly from your computer, you will notice that the RTEUploadDialog pops up in which you can browse for a file and select a location.

!cid_image001_png@01CC25D2!cid_image002_png@01CC25D2

Unfortunately, you can’t set the default location.

Workaround

Option 1: Because the “Upload to” dropdown list is filled up alphabetically, you can rename the library you want (eg. let it start with an underscore).

Option 2: (Not supported by MS) You can write some javascript to select another default value for the dropdown list. Insert your javascript into the RTEUploadDialog application page (/_layouts/RteUploadDialog.aspx).

As far as I know, this page is not only used for uploading images, so you probably have to take into account the querystring parameter ‘Dialog’ (/_layouts/RteUploadDialog.aspx?LCID=1033&Dialog=UploadImage).

Sunday, April 10, 2011

Reporting Services: RSViewerPage

The main file used for displaying reports is the RSViewerPage.aspx. This page contains a breadcrumb and a webpart called ReportViewerWebPart. This webpart renders a toolbar, the report and a parameters pane.

Hide buttons from the toolbar

I saw a couple of articles of people who disable some toolbar buttons by diving into the ConfigurationInfo table of the Reporting Services Database. This method will work for a few buttons, but not for all of them. I discovered that you don’t need to adjust that database table at all. You can use the ToolBarItemsDisplayMode property of the ReportViewer WebPart. This property allows you to hide/show specific parts of the ReportViewer’s toolbar. Be aware, this property is an enumeration field.

For example: ToolBarItemsDisplayMode=’223’ will hide:

  • Open with Report Builder (Action Menu)
  • Subscribe (Action Menu)
  • Atom icon

Before:

Toolbar

After:

Toolbar2

Why 223? You have to make the sum of the values of the parts you want to include in the toolbar. The values are shown in the reference table below:

ToolBarItemsDisplayMode

You can set the property by adding the property in the RSViewerPage.aspx like

<RSWP:ReportViewerWebPart id="m_sqlRsWebPart" runat="server" SuppressWebPartChrome="true" Height="100%" ToolBarItemsDisplayMode="223" Width="100%" />

OR

You can pass the property as a querystring rv:ToolBarItemsDisplayMode=”223”

Related posts:

Thursday, February 10, 2011

Ogone – Feedback Parameters

The merchant can send some extra parameters in the hidden fields of the order form, in order to retrieve them as feedback parameters after the payment.

One of the hidden fields is the PARAMPLUS parameter. This field submits some parameters and their values you would like returned in the feedback request (as a querystring).

Be careful when you generate your SHA-OUT hash based on the incoming feedback parameters. You have to exclude all the extra parameters, you sent with the PARAMPLUS parameter, before generating the hash.