Friday, December 23, 2011

Deploying SSRS 2008 Reports to SharePoint 2010 sites in Integration mode

 

Scenario: We have SSRS 2008 R2 configured for SharePoint 2010 Integration mode.

Requirement: We as a BI Developer, need to develop and deploy the reports to the SharePoint sites.

Walkthrough:

Step 1: Fire up BIDS – New Project – Select “Report Server Project” from the templates – Name the project “MyFirstReport” – Click OK.

Step 2: Let’s create the Shared DataSource. Right click the [Shared DataSources] in Solution Explorer and click “Add New DataSource” – Fill the [General] Section with the Name=”DataSource1”, Type=”Microsoft SQL Server” and edit the ConnectionString. We’ll select “Use Windows Auth” to connect to our DB for this example (This may vary based upon your Authentication mechanism).

Leave the [Credentials] Section with “Windows Auth” selected. Click Okay and you should see the DataSource1.rds created in the Solution Explorer.

Step 3: Now let’s create a report. Right click the [Reports] in Solution Explorer and click “Add New Report” – Go through the Report Wizard using the DataSource1.rds that we created earlier – Build your query by adding the appropriate tables – Select your Report Type (Table/Matrix, I’ll select Table) – Design your Table (I added all fields to the Details section) – Choose Table Style (Corporate) – Finish the wizard by naming the report “Report1”. You should see the Report1.rdl in the Solution Explorer.

Step 4: At this point, you can build the report and switch to the preview tab to view the report.

Step 5: It’s time for deploying our reports. Quite simple, just right-click on the project and deploy (if you want all the datasources and reports to be deployed in one go, else you can deploy them individually). Okay, right-click and deploy, uh Oh ! what happened. This is not what we wanted to see.

image

Okay, we never provided the SP Site URLs. Also, we need to make sure and plan where will our Datasources and reports should be deployed on the site.

Step 6: So let’s create the Document Libraries, one for Datasource and another for Reports. Browse the SP site and create them now. I created the following: [DataSources] and [Reports] without the braces [ ].

Step 7: Now, let’s get back to our BIDS project. Right click on the project and choose Properties. There you are, if you see the values there, they are the default values for SSRS in Native Mode.

image

So we need to change them to comply with our needs. Modify them as shown here:

image

Ok now that looks better. Let’s try to deploy again. It should do just fine. Browse to the “Reports” library on the site and click on the

You should be able to see the report.

Thursday, December 22, 2011

Configuring Anonymous access on SP2010 sites

The steps involved in enabling anonymous access to a SharePoint 2010 site are very similar to what we have been doing in MOSS 2007, so I won’t go into details of everything and do a quick walkthrough for achieving the same in SP 2010.

So here are the basic steps:

Step 1: Create the Web Application and the Site Collection.

Step 2: Select the Web App in [Manage Web App] section.

Step 3: In the ribbon, click [Authentication Providers].

Step 4: You’ll only see the “Default” zone, if you have just followed my instructions above and have not extended to any other zone. So, click the Default from the list.

Step 5: Select the check-box for [Enable Anonymous Access] and leave the [Windows Authentication] section as it is. You want this to sign-in using your AD account and grant access for “anonymous” users in the next step. (You may also want this to let you make additions/modifications to the site later.)

Step 6: Click Save.

Step 7: Next, login to your site using your AD account as the Site Collection owner.

Step 8: Go to [Site Permissions] – [Anonymous Access] on the ribbon – Then select “Entire Site” – Click “OK”.

Step 9: Once you are done with all changes/updates to your done, follow the Steps 2 through Step 5 again and uncheck the [Windows Authentication] and Click Save.

Step 10: You might get the error “401”, if you try to refresh the page after Step 9. In this case, clear your cache, close all the browser instances and try again. You’ll be able to get to the site without any login prompt.

So there it is. In just 10 steps you have been able to setup an anonymous site.

Thursday, November 3, 2011

Visual Studio Express 11 Preview – Designer not showing up

 

Okay, so now I have a Windows 8 Preview VM setup ready. The first thing that I wanted to get started with was the Metro Style Apps. Excellent !!!

Fired up my Visual Studio environment, created a new Metro C# Project and hit the very first wall. The designer view of my HelloMetro.xaml did not show up and instead gave me this error:

“Exception from HRESULT: 0x80270232" ………………

Wow, have worked quite a bit on Silverlight projects based on XAML but never seen anything such. Tried looking into the namespace of each of the .xaml and .cs files, even tried deleting and re-creating the project again.

But looks like there is a pre-requisites for the Metro-Style Apps here.

We need to set the VM resolution to anything higher than 1024X768.

There we go, it worked !!!

Sunday, October 23, 2011

InfoPath 2010 form publishing issues

Getting the InfoPath forms to render on the enterprise browsers may not be a simple approach.

I was left hunting for the below reason, when I started to publish a “Feedback Form” to a SharePoint 2010 Form Library.

I received the following error message “This form template is browser-compatible, but it cannot be browser-enabled on the selected site…”

image

Looking at the 3 different reasons listed in the popup, I knew I had my Form Services running. So wanted to check on which features should be available on the site collection.

Let’s go to Site Setting – Site Collection Features.

If we scroll down to verify the “SharePoint Server Enterprise Site Collection features”, that looks like was not activated by default. This feature as it describes enables the site collection to leverage the InfoPath Form Services along with several others. So let’s go ahead and “Activate” it.

image

Behind the scenes, it appears that activating this feature creates a “Form Templates” document library.

image

And that’s it. Let’s go ahead and try to publish our form again…successfully published !

Tuesday, October 18, 2011

DNS Validations in a SharePoint 2010 web parts

Recently, I got to perform a task during a SharePoint 2010 web part development, where it was required to check for the DNS validity. I needed to see if a newly built virtual-server was hosted correctly and DNS settings updated accordingly to make the server available over the enterprise network.

To start with, we need to make use of the class [IPHostEntry] available to us in the System.Net namespace. This will provide us a container class for Internet host address information. So we need to add this to the Project References and include the using statement:

using System.Net;

We will also use the [Dns] class in the System.Net namespace which will provide the simple domain name resolution functionality. This class has the GetHostEntry() method that will resolve the host name for us to an IPHostEntry instance.

So let’s jump into the code. Assuming, we have a textbox “txtServerName” and a button on the form named “btnValidate”.

protected void btnValidate_Click(object sender, EventArgs e)

{

  if (Page.IsPostBack)

  {

    string[] strRetValue = { "0", "0", "0" };

    strRetValue = ValidateDNS(txtServerName.Text.ToString());

    if (strRetValue[0].ToString() == "0")

    {

      //Display the error message: "DNS Validation failed!

      //Please  verify the name of the server or check if the server

      //has been provisioned correctly."

      …….

      //Your code when validation fails.

    }

    else

    {

// Display the Success message: "DNS Validation SUCCEEDED."

    …….

    //Your code.

   }

}

}

In the above code, we are simply trying to call the ValidateDNS() method. We pass the name of the server to be validated and grab the results of validation in the array of strings strRetvalue[].

This array contains two elements.

- 1st element would store either a “0” = InValid or “1” = Valid.

- 2nd element would store the actual host name if 1st element is “1” and NULL if it’s “0”.

- 3rd element would store any validation error messages generated.

So when we return from the ValidateDNS() call, we check to see the first element.

If it is equal to “0”, the validation had failed, else succeeded.

Now it’s time for the actual validation code.

Here’s what it looks like:

private string[] ValidateDNS(string p)

{

    string[] retValue = { "0", "0", "0" };

    try

    {

        IPHostEntry ipEntry; //The IP or Host Entry to lookup

        char[] myArray = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ-".ToCharArray(); //Value of alpha characters

      if (p.IndexOfAny(myArray) != -1) //If we see alpha characters,

      //that means it’s a forward lookup

     {

        //Resolve a host name to IPHostEntry instance.

        ipEntry = Dns.GetHostEntry(p.ToString());

        //Count returns number of elements in sequence.

        if (ipEntry.AddressList.Count() > 1)

       {

             retValue[0] = "1"; // Valid

             retValue[1] = ipEntry.HostName.ToString();

       }

      else

            retValue[0] = "0"; //InValid

   }

    //If no alpha characters, then it’s a reverse lookup

    else

    {

        ipEntry = Dns.GetHostEntry(p.ToString()); //Resolve it

    }

}

catch (System.Net.Sockets.SocketException se)

{

//The system had problems resolving the address passed.

retValue[2] = se.Message.ToString();

}

catch (System.FormatException fe)

{

//Some non-unicode characters were passed.

retValue[2] = fe.Message.ToString();

}

return retValue;  //Finally return the array.

}

I have explained each line of code with comments inline, so it shouldn’t be that hard to understand here.

This was all that was needed to do the DNS validation in a C# web-part code.

Technorati Tags: ,,

Monday, June 6, 2011

Windows 8 is born

This is the code-name for the next release of the OS that Microsoft is planning. As per MS, it will be HTML5 and JavaScript based, completely supporting the ARM technology for the touch-experience in the mobile and tablet world. Looks like would be available even to the PCs with the options to switch back to the Windows 7 look-n-feel for those, maybe the businesses, which are not yet ready to upgrade their hardware to the touch-smart PCs. I personally feel that MS has made the right move, though a little late, for a foray into the mobile world.

With the not so expected reception for Windows Phone 7, MS had to revamp the whole strategy.

But does that mean an end to the .Net, Silverlight. Maybe its too early to say that. With Scott Gu moving to head the Azure, Silverlight definitely needs some jumpstart from someone.

But how this HTML5 is going to have an impact is what needs to be watched for.

For now, lets wait and watch……maybe this video :)

Windows 8

Thursday, March 10, 2011

Processor Check Utility for 64-Bit Compatibility for VMware

There is good small utility out there on VMWare web site that can test your machine to ensure it has the necessary hardware for working with vmware virtual machines. There is a PDF available to with instructions on how-to. Available for Windows and Linux.

You can find it here:  Processor Check for 64-bit Compatibility

Thursday, February 10, 2011

IIS Tree not showing up

I was trying to bring-up SharePoint Central Admin on my old virtual machine (VPC 2007), but it never seemed to show-up.

When I tried to start the IIS Manager, I found no listings in it. I remembered, I had the same issue with one of my client recently and wanted to get to the root of this.

The only thing that I saw on the left pane was “IIS…” and the message “There are no items to see in this view.” on the right pane.

Looking at the Event Viewer – Systems, I saw this error specific to the “Service Control Manager” -

EventID: 7024

Error description: “The IIS Admin Service service terminated with service-specific error 2149648394 (0x8021080A).”

A little bit of web searching gave me a quick understanding about the metabase file getting corrupt and needed a restore from the IIS history folder.

Note: Some posts advised killing the inetinfo.exe in the TaskManager, which I never found as one of the processes.

So this is what I did to restore my previous metabase file (Here, it needs your intuition to make a call, and select a proper metabase file that you know would have been in a “GOOD STATE” before things got corrupted.) I compared the timestamp of the current file and looked for a file which was earlier than that. It worked for me and hopefully should work for you too :)

#1. Go to the folder location “C:\WINDOWS\system32\inetsrv” and backup the file named “MetaBase.xml”. Then delete this file from this location.

#2. Browse to the “C:\WINDOWS\system32\inetsrv\History” subfolder and choose the right .xml metabase file that you found to be in a good state. It should be called something like “MetaBase_0000013890_0000000000.xml”.

#3. Copy this file and paste it in “C:\WINDOWS\system32\inetsrv” folder.

#4. Now rename this to “MetaBase.xml”.

#5. Restart IIS. If the “IIS Admin Service” and all its dependent services are enabled, you IIS tree would start appearing. If not then probably, you need to look for each of the dependant services and try to start them in the order they need to be. Good Luck!!!

Friday, January 7, 2011

Working with PowerShell “cmdlets”

Pronounced “Command-lets”, cmdlets are a great way of scripting Administrative tasks in SharePoint 2010. I personally feel that I was missing such a tool till last year working with MOSS 2007. But with cmdlets, it looks extremely promising that Microsoft has ultimately provided the SharePoint Administrators – a single platform to script their tasks and run commands remotely/locally.

Recently, I was trying to look into these cmdlets and here are some quick view into some of the most basic ones.

Interestingly, these cmdlets are in a format that resembles the verb-noun pair. The noun generally starting with a “SP” for all SharePoint cmdlets.

#1. Get-SPContentDatabase: This gives you a list of all the Content DBs in your farm, with information on ID, Name, Server and Site count.

Okay, now you must be thinking that I am going to get nasty by listing down all these cmdlets, uhh… you are definitely wrong.

Instead, I just figured-out how to retrieve a list of such SP cmdlets and also how to pull more information about each of them.

Get-Command and Get-Help can be really handy for anyone starting on these. Here’s an example of how to use the Get-Command.

Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell”

Further-more, if you start creating your own scripts, you would also need to start using these two very often:

> Measure-Command: This gives you the cmdlets execution time.

> Trace-Command: gives you the ability for debugging short scripts.

Technorati Tags: ,,