Archive for June, 2012

This workbook cannot be opened because it is not stored in an Excel Services Application trusted location – SharePoint 2010

One of my colleagues sent me an email saying that he is getting this error (see below) whenever he tried to open an excel workbook. I just clicked the same file in the same location and I am able to open it. 🙂

But when I click on the excel file drop down –> View in Browser then I also got the same error.

The text format of the error is:

This workbook cannot be opened because it is not stored in an Excel Services Application trusted location.

To create an Excel Services Application trusted location, contact your system administrator.

According to the error message, obviously we need to add the document library path to Trusted File Locations in the Central Administration. So we will see the steps here.

Step 1: Go to Central Administration –> Manage service applications under Application Management

Step 2: Then click on the Excel Services Application

Step 3: Click on the Trusted File Locations

Step 4: Just click Add Trusted File Location under Excel Services Application

Step 5: Add the document library url (OR file location) on the Address box and check the  Children trusted check box –> Click ok

Please note: Don’t use like http://server:1010/documentlibrary1/forms/default.aspx instead of http://server:1010/documentlibrary1

If you use SSL (Secure Sockets Layer)/HTTPS connections, just add  https:// on the address.

If you want to read more about this just click here. The similar problem in SharePoint 2007 also, you can find the solution in my previous post.

After completing this configuration, you might get the “The workbook cannot be opened” error, if you want to get the solution just read here. 🙂

References:

1. http://sharepointknowledgebase.blogspot.ca/2011/12/excel-services-sharepoint-2010-trusted.html

2. http://technet.microsoft.com/en-us/library/ff191194.aspx

, , , , , ,

3 Comments

System.NullReferenceException in Silverlight application designer in Visual Studio 2010

This is my Environment:

  1. Windows 7 64 bit
  2. VisualStudio 2010 with SilverLight 4 developer runtime

ProblemAfter upgrading the SilverLight 5 client, I tried to create a SilverLight Application and then I have got the following wired error message on the design tab 😦

The text format of the error is:

System.NullReferenceException
Object reference not set to an instance of an object.
at Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.d__8.MoveNext()
at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption()
at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier)
at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context)
at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider)
at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors)
at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem()
at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem()
at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState()
at MS.Internal.Host.PersistenceSubsystem.Load()
at MS.Internal.Host.Designer.Load()
at MS.Internal.Designer.VSDesigner.Load()
at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
at MS.Internal.Designer.DesignerPane.LoadDesignerView()

Solution: The problem is the conflict of SilverLight versions and I have found the solution in this thread.

Step 1: Uninstall the latest SilverLight client which is SilverLight  5, the 1st one in the below control panel screen shot

Step 2: Uninstall SilverLight 4 developer, the next 1 in the above image

Step 3: Download and Install Microsoft Silverlight 4 Tools for Visual Studio 2010 (Add-on and pre-requisite files for Visual Studio 2010 to develop Silverlight 4 and RIA Services applications)

Installing..!

Installation finished successfully.

Restart the VisualStudio 2010, wow.. it’s working! 🙂

Happy Silverlighting..! Thanks R./

References:

1. http://connect.microsoft.com/VisualStudio/feedback/details/718259/new-ms-update-causes-vs2010-silverlight-project-to-have-error-in-design-wpf-editor

2. http://social.msdn.microsoft.com/Forums/en/vswpfdesigner/thread/01ce533e-ed94-48d2-8184-e2e34e6bdc6f

, , , , ,

12 Comments

DDL, DML, DCL and TCL Commands/Statements

Everybody knows about these statements but I just wanted to post this for quick references and also there is a new DML statement (MERGE) available in SQL Server 2008.

SQL commands are instructions which are normally used to communicate with the database to perform specific task and various other functions. Depending on the functionalities we can divide into 4 groups. They are DDL, DML, DCL and TCL.

DDL (Data Definition Language): is a vocabulary used to define data structures in SQL Server. Use these statements to create, alter, drop and truncate data structures in an instance of SQL Server. (MSDN Definition, you can read more here)

  • CREATE : creates an object (a table, for example) in the database.
  • ALTER : database modifies the structure of an existing object in various ways (Eg: adding a column to an existing table)
  • DROP : deletes an object in the database, usually irretrievably.
  • TRUNCATE : remove all records from a table, including all spaces allocated for the records are removed

DML (Data Manipulation Language): is a vocabulary used to retrieve and work with data in SQL Server. Use these statements to add, modify, query or remove data from a SQL Server database. (MSDN Definition, you can read more here)

  • SELECT : retrieves data from one or more tables, or expressions
  • INSERT  : adds rows (formally tuples) to an existing table
  • UPDATE : modifies a set of existing table rows
  • DELETE  : removes existing rows from a table, the space for the records remain
  • MERGE   : insert, update or delete operations on a target table. Normally called UPSERT operation

DCL (Data Control Language): is a vocabulary used to provide security such as roles and permissions in SQL Server. Use these statements to grant and revoke permissions to SQL Server database.

  • GRANT : gives user’s access privileges to database
  • REVOKE : withdraw access privileges given with the GRANT command

TCL (Transaction Control Language): is a vocabulary used to manage the changes made by DML statements in SQL Server. Use these statements to commit or rollback the transaction in a SQL Server database. (Read more here)

  • COMMIT : causes all data changes in a transaction to be made permanent
  • ROLLBACK : causes all data changes since the last COMMIT or ROLLBACK to be discarded, leaving the state of the data as it was prior to those changes.
  • SAVE TRANSACTION : save the state of the database at the current point in transaction

Please Note: I didn’t get a chance to work with ‘Save Transaction’, if you want to read more about this please click here

References:

1. http://culturalview.com/books/sql.pdf

2. http://www.orafaq.com/faq/what_are_the_difference_between_ddl_dml_and_dcl_commands

3. http://blog.sqlauthority.com/2008/01/15/sql-server-what-is-dml-ddl-dcl-and-tcl-introduction-and-examples/

4. http://msdn.microsoft.com/en-us/library/bb510625.aspx

, , , , , , , , , ,

2 Comments

Constructors and Destructors (C#)

This is for my quick references and I have taken most of the information from MSDN and other web sites. BTW I have written and tested the source!

Constructors
– Constructors are methods that are executed when an object of a class is created.
– They have the same name as the class.
– A class  may have multiple constructors that take different arguments.
– Constructors enable the programmer to set default values.
– Like class, structs also can have constructors.

There are 3 kind of constructors in .Net (as far as I know), they are

  • Instance Constructors -Used to create and initialize instances of the class
  • Private Constructors – A special type of instance constructor that is not accessible outside the class (cannot be instantiated)
  • Static Constructors – Automatically initialize the class before the first instance is created or any static members are referenced
Example:
public class A //Class Name A
{
public int i;
public A() // Constructor of A
{
i=1;
}
}
class Program
{
static void Main(string[] args)
{
A a = new A(); //Initiated with new Operator
Console.WriteLine("The initialized value is: {0}", a.i);

System.Console.ReadLine(); //This line is to stop the result window
}
}

Destructors
– are used to destruct instances of classes.
– cannot be defined in structs. They are only used with classes.
– A class can only have one destructor.
– cannot be inherited or overloaded.
– cannot be called. They are invoked automatically
– does not take modifiers or have parameters.

Example:
class A
{
public A()
{
Console.WriteLine("Constructor");
}
~A()
{
Console.WriteLine("Destructor");
}
}

 

class Program
{
static void Main(string[] args)
{
A a = new A(); //Initiated with new Operator

System.Console.ReadLine(); //This line is to stop the result window
}
}

Leave a comment

Content Editor Web Part (CEWP) & JavaScript duplicating entries in SharePoint 2010

Recently we have migrated our SharePoint 2007 application to SharePoint 2010 and we also had manually configured few web parts in the new environment. Most of the web parts were working perfectly like sharepoint 2007 but one content editor web part which shows the weather forecast had some wired repeating behavior! 😦

Here is the weather forecast web part in the 2007 which has JavaScript to update the weather from their web site.

The JavaScript code in the Source editor:

I have created the CEWP in 2010 and paste the source code in to the editor.

and Publish the page, It is working fine no? but not really..!

Whenever I edit the page, the web part is duplicating the weather widget like this!

After spending few minutes I have found the solution in this post, actually SharePoint 2010 does not support the JavaScript directly into the source editor. So we cannot copy and paste the JavaScript to the CEWP editor instead, we have to create the scripts as a txt file (paste into a Notepad and save), upload into the SharePoint and then pointing that file as the source of CEWP.

Step 1: Open a Notepad and paste the source code

Step 2: Upload the txt file into SharePoint

Step 3: Get the url path of the txt file and paste it on the content link property of the content editor pane on the right side and click ok.

That’s all. No duplication probs any more. Happy Migrating..!

Thanks. R./

References:

1. http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/

, , , , , , ,

3 Comments

Unexpected Error has occurred. Error is ‘SetParent failed for Database ‘AR633564737049916886′.’

When I was installing the Application Definition Designer, I have got the following wired error message! 😦

The text format of this error message is:

Unexpected Error has occurred. Error is 'SetParent failed for Database 'AR633564737049916886'.' --> SetParent failed for Database '<em>AR633564737049916886'.' --> Failed to connect to server. \BDC. --> An error has occurred while establishing a connection to the server. When connecting to SQL Server..

This  is not even a brief message to understand no? After spending few minutes, I have found the possible causes for this error.

1. Not enough permissions to configure BDC (Business Data Catalog) instance

2. There is no BDC instance on our SQL Server, this means the installation expects the BDC instance to continue.

In my case, I have adequate permissions for BDC, so the problem is 2nd one. If we run the BDCStudioSetup.msi file directly, Instead of running the setup.exe on the “BDC Definition Editor” directory then we get this error! 😦

You can see the complete installation and configuration of Application Definition Designer here.

Happy configuring..! Thanks. R./

References:
1. http://www.techyv.com/questions/setparent-failed-database-error-while-installing-data-catalog

2. http://www.microsoft.com/en-us/download/details.aspx?id=79

, , , , , , ,

2 Comments

Installing and configuring the “Application Definition Designer” tool – BDC

Everyone knows about the usage of Application Definition Designerthis is a Microsoft tool that comes with the SharePoint Server SDK. You can see the overview and the system requirements here. While installing this tool I have faced few problems, so I just wanted to keep the steps in my bolg.

Step 1: Download the tool and double click the “OfficeServerSDK.exe”, You will be getting this screen.

Step 2: Click Next 😦

Step 3: The Office SharePoint Server 2007 SDK has been successfully installed. Great!

Step 4: Navigate to SDK installation path\Tools\BDC Definition Editor\. The default installation path for the MOSS SDK is <%Program Files%>\2007 Office System Developer Resources\. For me this is the path..

C:\Program Files \2007 Office System Developer Resources\Tools\BDC Definition Editor

Step 5: In this directory, double click the setup.exe

Please Note: If you double click  the BDCStudioSetup.msi file directly, Instead of clicking setup.exe then you will get this error This happened to me when I installed! 🙂

Step 6: Click Accept and continue, this will configure the SQL client.

Step 7: Click Next and close! 🙂

Step 8: That’s all, you can run the “ApplicationDefinitionDesigner.exe” in the “All Programs”

Step 9: We are ready to create the ADF (Application Definition File) to configure the BDC (Business Data Catalog) now.

Thanks. R./

References:

1. http://www.microsoft.com/en-us/download/details.aspx?id=79

2. http://nareshbojja.wordpress.com/2008/09/08/setparent-failed-for-database/

, , , , , , , , ,

3 Comments

There are no Business Data Types loaded in the Catalog – Business Data Type Picker

I was working on BDC (Business Data Catalog), to display the user profile data from SQL Server in SharePoint 2007. I was using “Application Definition Designer”  (A Microsoft tool that comes with the SharePoint Server SDK, you can see the installation and configuration here) to generate the ADF (Application Definition File). I tried to access the Business Data Types on the SharePoint page and then I have got the following wired error message. 🙂

BDC is not a really new stuff, so I tried to find the solution on the web but I didn’t get any direct solution immediately. Most of them are suggested to check the permission but I have adequate permission for BDC. Finally I have got the solution form this thread. Actually this is a bug in the Application Definition Designer and I don’t really know why it’s still there!

There might be two reasons to getting this error.

1. Not having enough permission to access the BDC

2. The “Finder” method is not generating properly in the “MethodInstanceType” property.

In my case I had adequate permisioion for the BDC, so the  “Finder” method was my problem.

You can see the “MethodInstanceType” property has “IdEnumerator” method instead of the “Finder”. So just click the drop down list and select the Finder method.

Then just export the ADF again, the Business Data Type Picker is showing the entries now huh? 🙂

References:

1. http://social.msdn.microsoft.com/forums/en-US/sharepointbdc/thread/c069a168-5dd9-4f5e-90bf-872e0ce00d28 

2. http://lightningtools.com/blog/archive/2010/08/19/there-are-no-business-data-types-loaded-in-the-catalog.aspx

, , , , , , , , , , ,

2 Comments