Monday, June 29, 2015

Troublesome report troubleshooting

Creating reports in SSRS and uploading to CRM can be a pain sometimes. The report works just fine in SSRS (well, the CRM-Autofilters don't of course, but still), but when trying to upload it you get this fine and informative error message:

Not very helpful, so maybe the log file is:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147188072</ErrorCode>
  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.</Message>
  <Timestamp>2015-06-29T14:16:35.6330269Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

If you are not very used to reading this, the important part is:
An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.

Not really sure who that guy is. Anybody know him or her please leave a comment.

Ok. So, maybe the SSRS tracelogs have something. Let.s go to there, in my case it was in this path:
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\LogFiles

Yours is probably something similar.

The last entries in the log were:
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to GetItemTypeAction(/Contoso_MSCRM/CustomReports/{f27fb971-691e-e511-93fe-00155d01ac02}).
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to CreateReportAction({f27fb971-691e-e511-93fe-00155d01ac02}, /Contoso_MSCRM/CustomReports, False).
processing!ReportServer_0-2!1870!06/29/2015-16:28:36:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: , Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: Exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportPublishingException' was thrown.;
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to CreateReportAction({f27fb971-691e-e511-93fe-00155d01ac02}, /Contoso_MSCRM/CustomReports, False).
processing!ReportServer_0-2!1870!06/29/2015-16:28:36:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: , Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: Exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportPublishingException' was thrown.;
library!ReportServer_0-2!1870!06/29/2015-16:28:36:: i INFO: Call to CreateReportAction({f27fb971-691e-e511-93fe-00155d01ac02}, /Contoso_MSCRM/CustomReports, False).
processing!ReportServer_0-2!1870!06/29/2015-16:28:37:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: , Microsoft.ReportingServices.ReportProcessing.ReportPublishingException: Exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportPublishingException' was thrown.;

Again we are all filled with joy and happiness as it is all too clear what is wrong... Well, if you can see it, please tell me, because I can't. The logg seems to be a dead end as well.

And I am all out of logs to look for, I don't really think the IIS-log will help.

However, all hope is not lost and we must trust the force, and the force says that the problem is probably that we have some UI component that is weird or that there is some reference that is bad. So I went back to my report, and just for the hell of it, not that I use it that much anyway, pressed the "Preview" tab, and behold, I had replaced a datasets query with a new SQL statement and missed that a tablix had a reference to a field.

So, these are some ways to troubleshoot a report. Maybe I should have done it the other way round. :)


Gustaf Westerlund
MVP, Founder and CTO at CRM-konsulterna AB
www.crmkonsulterna.se

Friday, June 26, 2015

Non breaking Space in SSRS

Been working with creating classical reports in SSRS for a customer lately and there are some tricks that you sometimes need to employ. Today, I found one, so this article will be short. Non-breaking space in SSRS can be set as an expression with the value "=char(160)",

White Sands - a sort of white space - broken by some tracks.
If using IIF or just adding it to the end of the line is up to you. It is at least good to know.

That was a short post and the tensions is building towards the 1:st. If you don't know why, check back on the 1:st and you'll know why.

Gustaf Westerlund
MVP, Founder and CTO at CRM-konsulterna AB
www.crmkonsulterna.se

Friday, June 05, 2015

CRM 2015 Spring wave excel and browsers

Been working lately with a customer in CRM 2015 Spring wave and I must say I really like it! My number one feature is the lovely menu which I enjoy every time i use it!

If you havn't noticed the excel export/import functionality now supports .xlsx (finally!) which is great. I did have an issue with importing data into CRM from xlsx-file once, which might have been due to the fact that I had added a column by hand (with the correct field name!). The sad thing was that I got an error when uploading this and no option to download a log file. So, I don't really know what was wrong, but I think my new column was it. It was easily solved, anyway, I just saved the document as "XML Excelsheet 2003 format *.xml", which is the format used when exporting excel-templates in CRM 2011 and 2013. Importing that worked great. Some of you might think that csv-files are better, as the overhead is smaller in these, but I would warn against using these as I have had some issues with these. The most obvious being that the csv-format is regions sensitvie. With a en/us locale it will use the comma (,) as the separator but in Sweden (se/sv) it will use semi-colon (;). This will mess up a lot of.
Spring has come - when is summer comming?

Another messy thing of CRM 2015 Spring wave, that I think most users of it have noticed, if they are not blind, is that form customizations cannot be done in IE11. I cannot understand how this bug could have escaped Microsoft quality control, and it will most certainly be fixed. Hence I use Chrome when customizing CRM. This made me notice another bug, that being that when using Chrome, I cannot save new mappings, which works perfectly well in IE11. Isn't the multi-browser world wonderful! Just imagine the amount of money Microsoft must pour into this.

And on the subject of pouring money, we all want Microsoft to get us a lot of nice shiny features for CRM, and fix all the bugs, so how are we doing on the upgrades ourselves? Maintaining a lot of different code trees costs a lot of resources, which could have been used to other stuff. Think about that when you are requesting fixes for CRM 4.0.

Gustaf Westerlund
MVP, Founder and CTO at CRM-konsulterna AB
www.crmkonsulterna.se