I own a ASP.NET web project with framework 4.5. Is installed and implemented an SAP report for VS2012 Crystal Reports Developer.
Making in Local report, it works correct
I had a situation where I had some Crystal Reports created using connection "SQL Server Native Client 11.0" and some using connection "Microsoft OLE DB Provider for SQL Server". Both worked on our old server running IIS 6. However, when we migrated over to a new server running IIS 8.5, some reports worked as expected, while others displayed an empty Crystal Reports viewer. After 4-5 days of pulling my hair out and trying everything I could think of, I finally compared everything between the reports that worked vs. the reports that did not work. What I discovered was the reports that worked used the "Microsoft OLE DB Provider for SQL Server" connection. Once I made this change, the reports served up perfectly.
I believe you need to deploy it as .Net 4, not .Net 4.5.
Solved.... 100 % 'll work. Follow the below two steps:
1.Update Application Folder.
"C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13" into your application root folder asp below snapshot.
For those of us running migrated projects from .Net 4.0 or lower to 4.5+ I have made an observation. It seems if your page that contains the viewer is in a subdirectory then the image urls are being generated relative to that page and not to the root of the web application. E.g if your page is /gl/accounts.aspx then the image may be /gl/crystalimagehandler.aspx etc A quick way to fix this is to change your handler mapping to a wildcard ending in crystalimagehandler.aspx or put the following code in Global.asax
protected void Application_BeginRequest(object sender, EventArgs e)
{
var p = Request.Path.ToLower().Trim();
if (p.EndsWith("/crystalimagehandler.aspx") && p!= "/crystalimagehandler.aspx")
{
var fullPath=Request.Url.AbsoluteUri.ToLower();
var index = fullPath.IndexOf("/crystalimagehandler.aspx");
Response.Redirect(fullPath.Substring(index));
}
}
For me, the webpage Developer Tools (F12 then Console tab) showed that the server was looking for root/aspnet_client/system_web/4_6_1069 folder when I had copied the files into the 4_0_30319 folder. I renamed the folder and BAM!
I have smiler problem and found a solution.
I think there is some problem in finding Resource from default Resource-Uri
for formatting of crystal report.
For proper formatting
Copy C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13
this folder into your project.
And past these lines into your web.config file
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
</sectionGroup>
</sectionGroup>
</configSections>
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource="true" />
</rptBuildProvider>
<crystalReportViewer>
<add key="ResourceUri" value="/crystalreportviewers13" />
</crystalReportViewer>
</crystalReports>
</businessObjects>
Check this
This will help you.