Monday, April 27, 2009

SSRS Web Services in SharePoint Integrated Mode Example

Hi all

We have been lately trying to get Reporting Services working with our SharePoint and so far it is playing nicely.
I have managed to get together a piece of code that will load a report template that is stored in SharePoint site and render the report in a browser. Well, I found the code in the description of the "Render" method in MSDN Documentations.

Here is a list of links that might be useful to read:
The below code is
You will have to add web references to the ReportExecution2005.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ReportingServiceWebServicesTest.CecilAdmin08ReportExecution2005;

namespace ReportingServiceWebServicesTest
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ReportExecutionService rs = new ReportExecutionService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Render arguments
byte[] result = null;
string reportPath = "/reportingservices/Reports/Report1.rdl";
string format = "HTML4.0";
string historyID = null;
ParameterValue[] parameters = new ParameterValue[2];

string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
string[] streamIDs = null;

ExecutionInfo execInfo = new ExecutionInfo();
ExecutionHeader execHeader = new ExecutionHeader();

rs.ExecutionHeaderValue = execHeader;

execInfo = rs.LoadReport(reportPath, historyID);

parameters[0] = new ParameterValue();
parameters[0].Name = "param1";
parameters[0].Value = "2";

parameters[1] = new ParameterValue();
parameters[1].Name = "param2";
parameters[1].Value = "5";


rs.SetExecutionParameters(parameters, "en-us");
String SessionId = rs.ExecutionHeaderValue.ExecutionID;

result = rs.Render(format, null, out extension, out encoding, out mimeType, out warnings, out streamIDs);

Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
//Response.ContentType = "application/pdf";
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
}
}
}

Wednesday, April 22, 2009

SharePoint site usage report or reports

SharePoint offers a way for web sites owners to view some statisticts about who is visiting thier site, which pages were accessed, and who is refering to thier site. These are called "Site Usage Reports" or "Site Usage Report" if you havn't enabled the MOSS Standard site features.

All the documentations that describe the process of enabling the "Site Usage Reports" fail to mention that you need to enable the "Office SharePoint Server Standard Site features" on the site to get the advanced statistics.

You will need to enable this feature so you can display some more advanced statistics about the site, as shown in the picture.

It took me a while to figure out why some of my sites were displaying these advanced reports and some weren't.

The advanced reports page has the following url:
~/_layouts/SpUsageSite.aspx
while the normal usage reports has
~/_layouts/UsageDetails.aspx

At the moment, I'm having a problem with displaying the data in the advanced usage reports, however, the normal reports succeeds in displaying them.

References:

Monday, April 20, 2009

SP2 for Office products due to be released at end of this month

Microsoft announced that the Office SP2 will be released on the 28th of April 20009. The Service pack will include new updates to office products including SharePoint.

http://blogs.technet.com/office_sustained_engineering/archive/2009/04/16/service-pack-2-for-the-2007-microsoft-office-system-due-to-ship-april-28th.aspx

The interesting bits to SharePoint were the following:

    version of SharePoint and provides feedback and best practice recommendations on your current environment.
      SP2 offers support for a broader range of Web browsers.
        Substantial improvements to Forms-based authentication.

        I wonder what is the FBA improvements! I would love to see any "claims based authentication" components in the improvements. Can't think of anything else.


        Saturday, April 18, 2009

        SharePoint Server 2010, no more "14"

        So, in case you haven't heard yet, Microsoft dropped the "14" from the next version of SharePoint Server. Yes, there is no "Office" in the name. Microsoft also dropped the word "Office" from SharePoint and therefor, MOSS is no longer an acronym to SharePoint.

        You may ask, what about WSS? Microsoft says, that there will be a new version of WSS (v4), and they working on it.

        For more info about this read Microsoft's official post here

        Thursday, April 2, 2009

        Navigation Menu in Sharepoint corrupt

        If you get the following error:

        "The page has been modified by another author on ..."


        when modifying the SharePoint Site Navigation, then it is probably because of a corrupted heading node. If you find the target URL for the heading set to something like "/_layouts/viewlsts.aspx?BaseType=0?BaseType=0?BaseType=0?BaseType=0" then the heading is corrupted.

        To fix the problem, you will basically have to remove them, and the header either manually, or using the list settings.

        This is a known bug and allot of people have been experiencing it.

        Refrences: