It was one of those unexpected errors that can drive you crazy since they provide absolutely no details as to why they are happening. Yet, I was not doing anything extraordinary – I was merely trying to create an SSRS report for Dynamics 365(turned out that’s an extraordinary task.. sometimes), it was 11 PM on Friday night (yes, I know.. who does it at 11 PM on Friday night.. ), and I was constantly getting this error:
I was also getting it at 12 AM, and at 1 AM on Saturday, and, then, I called it a day and gave up (only to get back to it on Saturday – see below)
The error went like this:
Error Uploading Report
This report can’t upload. This issue can occur when the Report Definition Language (RDL) file is not valid. If you contact support, please provide the technical details.
Activity ID: 47ebe340-68ed-4a4c-95b0-b5e1061c2b57
And, of course, it had some details in the log file:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An error occurred while trying to add the report to Microsoft Dynamics 365. 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”>
<ActivityId>47ebe340-68ed-4a4c-95b0-b5e1061c2b57</ActivityId>
<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 365. Try adding the report again. If this problem persists, contact your system administrator.</Message>
<Timestamp>2017-06-18T01:11:45.2743564Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil=”true” />
<InnerFault i:nil=”true” />
<OriginalException i:nil=”true” />
<TraceText i:nil=”true” />
</OrganizationServiceFault>
Unfortunately, those details were not particularly useful.
Did I mention I never created reports for Dynamics 365 on this particular laptop? So, before I started on Friday night, I had installed the following components:
- Visual Studio 2015 and Data Tools
- Report Authoring Extensions for Dynamics 365
That is supposed to be a supported configuration, according to the download page:
https://www.microsoft.com/en-us/download/details.aspx?id=50375
And, yet, it was not working.
So, how do you troubleshoot an issue like this? You can keep poking around, but there is a simple test:
- I’ve created a new report using Dynamics report wizard
- And downloaded it
- And loaded it into the Visual Studio
- Did some minor changes
- And tried to upload it back into Dynamics
Guess what – I got exactly the same error! But that meant I was onto something, and the only possible explanation was that Visual Studio had updated the report in such a way that it became incompatible with Dynamics somehow.
What could be incompatible? It would likely be the format of that RDL file. The report was working fine in the Visual Studio, though, so I spend about an hour looking at the schema, trying to get some clue.
And then I thought: is there actually a way to target different versions of the SSRS server when building a report? That was actually the right question, and there was an answer:
Did you happen to think it was the end of it? Well, why would it be.. I am writing a detective story here:)
So, no, it was not the end. I made those changes, I configured the project to target 2008-2014 versions:
It was around 10 AM on Saturday, btw..
And I tried uploading the report to Dynamics. The same stubborn error showed up again!
I spent the following 30 minutes scratching my head – this was kind of beyond me. But you can’t keep scratching your head forever when you need the report to be up and running.. so, why is it not making any difference. Was it the wrong option? I was on the right track – that was my gut feeling at that time. What did I miss? After a bit more scratching, I figured why don’t I look at the rdl again – may be I’d be able to spot the version number there? Sure enough, it was right there, right at the top of the file, and for some strange reason it was still telling me the report was targeting 2016 version:
Now this was strange..
What do we do when there is a question? We ask google. Here is what google answered:
God bless you, Google! And Rami A, whoever you are, who provided the final clue:
This is by design.
See https://connect.microsoft.com/SQLServer/Feedback/Details/2103422
Posted by Riccardo [MSFT] on 12/18/2015 at 5:07 PM
By design, TargetServerVersion affects build output files, not source files. You deploy the build output files (which you can grab from the \bin\Debug or \bin\Release folder within your project) rather than the source files.
So there we go! If you ever run into this problem, do this:
- Change the target server version of your report project (make it 2008, …, 2014)
- Build/Rebuild the project!!
- Do not upload the original rdl file to Dynamics – instead, use the one you’ll find in the “bin/debug” or “bin/release” folder
(and, probably, don’t do those things in the new environment on a Friday night when you are supposed to be getting ready for the weekend instead:) )
Pingback: Setting Visual Studio correctly for Dynamics 365 Reporting | Strategy 365 Limited
This helped me on the same error message. Thank you!
The second answer to this question also provides the answer and a bit of context… https://stackoverflow.com/questions/38902037/ssrs-report-definition-is-newer-than-server
Thank you very much you’re a life saver
Horror story, like I said.. but, at least, apparently I’m not alone in this:)
Thankyou sir. I can’t imagine finding that answer any faster than you would have – days, instead I spent 20 minutes.
THANK YOU!
It saved my day and my efforts
Thank you very much !!
You saved me thank you so much.
To be more explicit. To Change the version.
‘Change the target server version of your report project (make it 2008, …, 2014)’
Right click on the name of the Project on the right hand side of the screen under ‘Solution Explorer’ pin. In Visual studios.
Click on properties, then you use see that screen above
Yes, yes, a thousand times yes. I have struggled with this for hours.
For me, after building, it was the report in Debug that worked when uploading.
This has saved my sanity for another day.
Thank you so much .. It worked!
Thanks you Alex so much. Yes I ran exactly on a Friday night but guess what I didn’t end up with a horror story and the reason is this blog post. Thanks once again.
:))
Hi
As soon as I add an image to the project I have the same error when i reupload.
I can use existing image resize them etc. But adding new images is giving me the same error.
Thank you so much! I was just about to tear my report apart looking for incompatible parts before I spotted this. Can’t believe it was so simple, and yet so obscure if you don’t know the cause.
Thanks. This is the best story I’ve heard so far in year 2018! You saved me.
This blog saved my number of hours. :). Thank you.
Good Info , it will save time of developers.
Was struggling with this error for a day, at last resolved.
Thank you so much so very much !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You are a life saver…spent 4 hours before hitting google and found you blog..Microsoft need to improve on showing right error… Thank you for your time to write this blog and helping others.
-Bob
Thats a great post..thanks!!!
Wow. Thank you very much. I was stuck for hours on this.
This is a fabulous post and saved me hours. Thank you!
Great post ! Saved me a ton of time. Thanks!
Thaaaaaaanks youuuuuuuuuuuuuuuuuuu
Count me among your many grateful fans! Thank you.
It took me three days fighting around with data sources, data sets, IIFs, xml, the CRM dynamics Wizard, the Visual Studio – everything until eventually I encountered your blog! That solved my problem immediately! Thank you so much, man!
Thanks a ton Man.. really Helpfull!!
Thanks for information – help me when installing to customer using older version of SQL. Been using VS 2017 to design reports when previously using older version so XML tag changed to 2016 causing error on loading on-site.
Thanks again and a Relatively easy fix.
Thanks! Helped me resolve the issue
YOU are the MAN!! thx a ton!!!
You utterly ROCK!! Thank you !!
Alex,
Please let me know where I can order you a pizza.
I can’t believe this is still an issue.
Your resolution totally worked.
Thank you, 5 minutes instead of a day or two