Dynamics CRM – Issue with publishing reports for external use – System.Web.Services.Protocols.SoapException: One or more data source credentials required to run the report have not been specified.

We have quite a few reports in Microsoft dynamics CRM 4.0 which are normally run from within CRM 4.0 without any issue. Some of the reports are added to SQL Reporting Server utilising dynamics CRM but are accessed externally from an ASP.NET application outside CRM boundary.

The ASP.NET application prepares a request including parameter required to fetch report with selective results in Excel format.

These reports were working on staging server but, however, as soon as I deployed them on live server I started getting the following error:

“System.Web.Services.Protocols.SoapException: One or more data source credentials required to run the report have not been specified.”

Later I found out that the issue had nothing to do with ASP.NET application but rather running reports that have been published for external use.

It took me a while to gather the pieces of information on Google and finally I manager to resolve the issue without the need of pulling my hair apart.

In order to figure out the cause of the issue, follow these steps

  1. Navigate to SRS report manager URL (http://<report server name>/reports)
  2. Run the report
  3. If you are prompted for credentials then this is the issue. You should never be prompted with credentials

Solution

Any report that is published using CRM is put into the CRM 4.0 root folder. Each reports inherits the datasource available in the root folder with the name of “MSCRM_DataSource” and have the option (“Credentials supplied by the user running the report”) selected as shown in the image below

Reports run without any issue when running from within CRM but fail to execute when executed from ASP.NET application.

The workaround I managed to run the report was to override the report datasource properties as follows:

  1. Navigate to SRS report manager URL (http://<report server name>/reports)
  2. Select report properties which is executed externally
  3. Select Data Sources link on the left hand side under Properties tab and enter the details as shown below:
  4. Execute the report from ASP.NET application and it should run fine

This is the way report, published through CRM, work. In my case it didn’t work even if I supplied the domain administrator’s credentials. So I followed more traditional approach with Windows integrated security and not from CRM.

It worked for me, tests were successful. I hope this helps someone who come across similar if not the same issue!

Advertisements
Posted in .NET C#, Microsoft Dynamics CRM, SQL Server | Tagged , , , | Leave a comment

How to export more than 10000 records in CRM 4.0

I have been working on CRM 4.0 project for quite a while but recently our client asked us to enable them to be able to export more than 10000 numbers of records to Excel utilising CRM’s “Advanced Find” utility.
CRM, by default, only allows not more than 10000 records to export to Excel. There are couple of ways to increase that limit.

Note: CRM generates Excel on the server side by creating a temporary file in memory and transfers the file through HTTP stream to the client side. I guess the limit is there to ensure server’s optimal performance. If different users are requesting a large chunk of records then it can impact server’s performance. I mean, do it only when you know what you are doing ;-).

Update entry for MaxRecordsForExportToExcel in OrganizationBase table

1. Log on to SQL Server where CRM database is stored
2. Edit OrganizationBase table
3. Find MaxRecordsForExportToExcel column and update the default entry with the one that suits your needs
4. Restart IIS or Application Pool under which CRM website is running for the changes to take effect
5. Restart of Application Pool is recommended if the server is hosting more than one websites

Increase limit via Registry

1. Open windows registry (Start -> regedit)
2. Now navigate to “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM”
3. See if there is an entry called “maxrecordsforexporttoexcel”
4. If there is one already then edit the entry and modify the value which is by default 10000
5. If there is no such entry already available select “Edit -> New -> DWord Value” and select decimal and enter the value of the number of records you want to be able to export to Excel
6. Exit registry
I followed the SQL version and was successfully able to export more than 10000 records. The reason I have included Registry method to increase limit so that my friends, who do not have knowledge of SQL or access to SQL Server can benefit from it
Hope this post helps, enjoy!!!!

Posted in Microsoft Dynamics CRM | Leave a comment

Encountered an error hydrating edmx file

I have recently realised that after installing Visual Studio 2012 RC all the projects containing the edmx file fails to compile with the following message:

– Encountered an error hydrating the EDMX file

– Could not load file or assembly ‘Microsoft.Data.Tools.Schema.Sql, Version=11.0.0.0, Culture=neutral, PublicKeyToken=c15f5f6t12e50a1a’ or one of its dependencies. The system cannot find the file specified.

I have seen people talking about removing all Visual Studio versions and do a clean install which simply wasn’t acceptable to me so I found my answer on the Microsoft connect page

Cause:

This issue is caused by installing a pre-release version of Visual Studio 2012 on top of Visual Studio 11 Developer Preview as stated by “Entity Framework Team”

Workaround:

– close all Visual Studio instances

– delete the file C:\Program Files (x86)\MSBuild\4.0\Microsoft.Common.targets\ImportAfterMicrosoft.Data.Tools.Integration.targets
– open the solution in your favourite VS and try again.

It did work for me

Posted in Microsoft Visual Studio | Leave a comment

Visual Studio 2012 RC – Error while trying to run project: invalid pointer

Previously I posted a workaround to launch a web application in debug mode here. I have come across a similar issue while running a console application in debug mode. This time the error description I came across was as follows:

“Error while trying to run project: invalid pointer”

Again, I don’t know the reason of this error but I managed to figure out a workaround. To be able to run a console application in debug mode, follow these steps:

  • Select the project (in solution explorer) you want to run in debug mode
  • In the Debug menu click on <project name> properties
  • select the debug tab
  • check “Enable native code debugging”

You are good to go. I don’t know if this is the bug on Microsoft part or there was an issue with my installation but I thought someone may come across the similar issue and this workaround might help.

Note: I have not tested the WinForms or WPF application yet so I am not sure if this solution applies to those application. You can give it a try anyway.

If anyone come across a permanent fix then please let me know as well. I will be extremely grateful.

Posted in Microsoft Visual Studio | 2 Comments

Visual Studio 2012 RC – unable to launch the configured visual studio development web server.invalid pointer

I was quite excited to try my new Visual Studio 2012 RC installation so decided to create a new web application. When I first try to run my application in debug mode (F5) I came across the following error

“unable to launch the configured visual studio development web server.invalid pointer”

The VS let me run the application without debugging which is quite annoying. The quickest workaround I could find, is as follows:

  • Run web application without debugging (CTRL+F5)
  • VS will launch your web application whichever web server have been specified. By default VS uses iisexpress which comes with VS 2012 RC
  • Now select Debug -> Attach to Process and select iisexpress.exe from the Available Processes list
  • Click Attach
  • Specify the break point in your code and you are ready to roll

As I mentioned above this is a quick workaround to the problem I came across and definitely not a recommended solution. I will post a better solution if I manage to find one but in case you see that I haven’t posted anything new on this topic and you know a better solution then, please, let me know. I will be over the moon, extremely glad and thankful to you …. in the mean time enjoy if my post helps you in any way!!!!

Posted in .NET C#, Microsoft Visual Studio | Tagged , , | 1 Comment

How to synchronise directories outside “Google Drive” and Dropbox folders – NTFS junction point

I have come across this issue while I was working on a project and at some point decided to sync my project folder on cloud. I already have cloud accounts with Google and Dropbox but unfortunately both work with default folders i.e. “Google Drive” and “Dropbox” respectively. It was absolutely not convenient for me to put my project folder in either of them. Specially when I wanted to sync my folder with both.

Then I google it to find out the solution to my problem. I have come across the term “NTFS Junction Point” which I never heard of before. After a little bit of research it sounded like the solution to my problem.

“An NTFS junction point is a feature of the NTFS file system that provides the ability to create a symbolic link to a directory which then functions as an alias of that directory. This has many benefits over aWindows shell shortcut (.lnk) file, such as allowing access to files within the directory via Windows Explorer, the Command Prompt, etc.”

well, to be honest I copied this definition from wikipedia so if you want to know more about it then click here.

Also the documentation about “mklink” (the command to create junction point) can be found here. This blog is to share the difficulties I came across due to the poor documentation about the use of these commands.

The command to create a junction point as stated on MS website is as follows:

mklink [/j] <Link> <Target>

where <link> is the junction point and the <target> is the original folder that is to be synchronised with Google or Dropbox.

There are couple of points which are very important to consider while creating a junction point. Let’s start with the basic one:

  1. Do not forget to use double quotes when <Link> or <Target> path contains spaces e.g. mklink /j “c:\dropbox\link folder” “c:\projects\target folder”
  2. make sure the “link folder” that you specified in the command does not already exist otherwise you will come across the error message “Cannot create a file when that file already exists”. This means mklink command will automatically create the “link folder” for you and will throw an exception if the folder already exists. Again “link folder” was non-existent and created by mklink command while “target folder” was the original folder with files and sub-folders in it.

NOTE: This workaround was tested only against Dropbox. GoogleDrive is included only on the basis of mere assumptions.

Hope this makes sense to you …. and if not then I don’t mind you to help me improving it 😉

Posted in NTFS File System | Tagged | 12 Comments

How to enable tracing in Microsoft Dynamics CRM

If you are a developer and working with Microsoft Dynamics CRM then having knowledge about CRM tracing would be the deadliest weapon in your arsenal. Review and bookmark the Microsoft support site here.

Posted in Microsoft Dynamics CRM | Leave a comment