Crystal Reports images not visible in web viewer - crystal-reports

I have some Crystal Reports (V10) in an application (.NET 1.1) I inherited that is deployed in four "identical" environments. In three of the environments, they are working fine. In the fourth, the chart graphics are not visible in the web viewer. They are visible if you export the reports.
The IT guys swear everything is exactly the same in all four environments and have kicked the problem back to me to solve. I'm not sure how I'm going to do that since I can't get to the servers to check anything for myself. But I don't see how this can NOT be an environment issue.
It seems to me that Crystal has the necessary permissions to write the file and to retrieve it to render the export versions of the report, but the ASP WP can't access the graphic file when the page is rendered.
Thanks for any suggestions you might have to help me!
RESOLUTION
From the IT guys: "We had to change the “Execute Permissions” on the CrystalReportsViewer10 folder within IIS from “Scripts only” to “Scripts and executables”. All of the other sites have only “Scripts Only” and they’re fine."

I could resolve this issue in dev enviroment adding next keys (handlers) to web.config:
<system.webServer>
<handlers>
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
</handlers>
</system.webServer>
<system.web>
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
</system.web>

There needs to be an IIS virtual directory called something like "CrystalReportViewers115". I think that the exact name changes between versions. This needs to be visible to your ASP.NET user. Start looking at the environments that work and see if they have this virtual directory installed, and compare it to the one on the failing environment. As another check, you should be able to enter in the URL for the images into a browser and see them. To find out the URL, right click on the picture and select "Properties". For example:
http://localhost/crystalreportviewers/images/toolbar/export.gif
You should see the picture when you browse directly to the URL.

Go to Start->Programs->Microsoft Visualstudio 2008->Visual Studio Tools->Visual Studio 2008 Command Prompt
and type
aspnet_regiis -c
This will automatically copied the corresponding files...

Add the aspnet_client folder in the source folder of the site. Example:
C:\inetpub\wwwroot\myapplication\aspnet_client\system_web\4_0_30319\CrystalReportWebFormViewer4

I recently experienced this very issue: although my resolution was a little different:
I tried setting the handler in the web.config but that didn't fix it.
I tried setting scripts & executables in IIS but that didn't fix it.
Once I went into the C:\Program Files\Common Files\Crystal Decisions\2.5\crystalreportviewers10 folder and turned off custom errors I could see the error was coming from an access denied issue on C:\Windows\Temp\
The solution was then to not and handlers or alter IIS to run scripts and executables, it was to allow the Network Service to read permission on C:\Windows\Temp\
EDIT:
Think I've found another solution which doesn't require permission changes... just set a virtual directory for aspnet_client; the level at which you select this will very much depend on your IIS layout.

Related

Not able to get MongoDB.driver nuget for Webapi project

I am new to MongoDB and is trying to get this new Database connected with my Web api application ..But i am not able to add MongoDB.driver nuget for my Webapi project.Please refer screen shot.
My search is struck on this window for like forever.,have even restarted my project for a couple of times now.
I also tried installing this package through
PM>Install-Package MongoDB.Driver
But then this is shown
Am I doing something wrong ..?
i tried opening this url"api.nuget.org/v3/index.json"...but it says this site cant be reached..what does that mean?
Since the you could not open the url in browser directly, there should be some internet limitations in your internet environment. If you are work in the company, I suggest you contact your office IT to confirm whether they add any limitations and whether used any proxy. If they are using some proxy, you need to set the proxy settings in NuGet.Config file which store in C:\Users\user name\AppData\Roaming\NuGet as below settings. Detailed information please refer to the Proxy settings part in Nuget Config Section & Nuget Proxy Settings.
<add key="http_proxy" value="host" />
<add key="http_proxy.user" value="username" />
<add key="http_proxy.password" value="encrypted_password" />
Besides, you can chech the proxy in your machine: Open "System Properties" > Advanced > Environment Variables. Find the http_proxy var (in System variables), select and delete it.

SAP Crystal Reports Viewer does not display in browser

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 correctly in browsers (Chrome, Firefox, IE) and the data in the correct exit. Now, at the time of publishing (on another server) the first thing we did was install the same version of SAP, so that there are the necessary libraries etc..
The problem I have is that the block of Report Viewer, I mean, what is the repot container, not shown in the browser, open the window where is this embedded but not shown anything in the Report Viewer, what the report will look even less.
Thinking it might be a data error or something, I tried to change the report and put a blank, where all that is shown is a text, and no connections or anything like that and removing the code that is not needed in the code behind, I just stopped loading the report.
In new local works, but on the web published, the Report Viewer still be
Anybody can help me a bit? I looking for some information about it but what I find in forums related, is that the report is not seen, but nothing of Report Viewer.
Thank you very so much in advance.
PS: I have checked the server log for error to any issue or Asp.Net Crystal Reports and not leave anything.
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.
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.
Update Web.Config file by the following code.
After copying the folder "C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13" into your application root folder, be sure you copy and paste the give code:
<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>
Right after < configuration > tag in web.config file. for me any other place did not work and generated Error message.
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 believe you need to deploy it as .Net 4, not .Net 4.5.
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));
}
}
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.

Azure Cloud Deploy Keeps Recycling

I get the following error:
Recycling (Waiting for role to start... Sites are being deployed.
[2012-12-17T05:30:10Z])
Running One or more role instance is unhealthy. 1 Instance: 1
Unhealthy
i was actually trying to convert my web application to a cloud applicaton.
here is what i did:
i added a cloud project to my solutions,
i added a webrole which linked to my web app
i created an sql azure database and copied my whole structure and also the data to the db
i inserted the connection string in my webconfig and tried to run it on emulation, this worked fine
then tried to deploy it by creating a cloud service, running the builder to create the packages and uploading the packages in "staging" mode. this is where i got the errors.
i tried to create an empty cloud app and add a default webrole and load this to the cloud, this worked fine. so i figured, maybe i have something wrong in my settings of my webrole.
I checked the difference between both and i noticed that in both solutions diagnostics was enabled but the storage account was empty in my own solution, so i inserted "UseDevelopmentStorage=true" here. this didn't change anything tho. I also saw a difference in the "packages.config"
default role had:
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.7.0.0" targetFramework="net40" />
<package id="System.Web.Providers" version="1.1" targetFramework="net40" />
<package id="System.Web.Providers.Core" version="1.0" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="1.7.0.0" targetFramework="net40" />
mine had:
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.7.0.0" targetFramework="net35" />
<package id="WindowsAzure.Storage" version="1.7.0.0" targetFramework="net35" />
i tried changing in this and uploading, didn't do anything
I am not using a worker role, i have only 1 running instance (same as default)
my application uses some authentication in global.asax where it tries to read from User.Identity.Name and compare with a user in the database (this user is inserted in the sql azure db). At first I thought this would maybe be the cause of the problem, but even if i comment out this code the application will not run on the cloud.
VM size is small, trust level = Full trust
I also saw some differences in the settings where i had remote access parameters. I tried removing all these just to exclude issues
i read something about settings references to "copy local is true", but im not sure if this will do any difference.
Any ideas because I don't really know what to do anymore
EDIT:
I modified all the references to "copy local is true" and i disabled to diagnostics just to be sure there's nothing wrong with it.
but now i get the error:
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Funny thing is, in my webconfig this is already set... And I can only find 1 webconfig.
I'm not quite sure what I'm doing wrong
"Keep recycling" almost always means that there are some exception occurred when your application was started. You might not be able to see any errors or exceptions in through the Diagnostics Montor since your exception might be occurred before you configured and started the diagnostics.
I recommend you enable the IntelliTrace option when deployment. It's very easy to do if you are using Visual Studio. Then you can retrieve the IntelliTrace result through Visual Studio and figure out what exception occurred. I strongly considered there are some references missed on azure that you need to set Copy Local = true. But you need IntelliTrace to find them.
The problem was that I had some referenced projects that had an app.config file with a string to a local database

VS2012 WebDeploy Publish Breaking Web.Config

I have a MVC3 Web Application project that I develop and publish from Visual Studio 2012. This was recently a VS2010 project that was migrated.
My web.config is setup using a <location inheritInChildApplications="false"> tag so that a child application running in a virtual directory does not take on the settings.
I have setup a WebDeploy publish profile, which worked flawlessly in VS2010, but breaks my application when published from VS2012. It adds a <connectionStrings> node after the closing aforementioned </location> tag, even though I already have a <connectionStrings> node inside my <location> node. This breaks the app due to an invalid configuration file.
I've tried re-creating the profile from scratch which didn't solve the problem.
Based on what I have read here, http://msdn.microsoft.com/en-us/library/dd465337.aspx, unchecking the "Use this connection string at runtime" checkbox should instruct the publish process to NOT add the connection string, but it does anyway.
I'm thinking that this would not be an issue if I wasn't using the <location inheritInChildApplications="false">, because the connection string would get added to the right spot.
Also, note that if I publish to the File System instead of using WebDeploy, the published Web.Config is created correctly and does NOT have the extra connection string node added.
Are there any known workarounds for this issue?
As I suspected, this issue is related to the inheritInChildApplications attribute. It is likely a bug in the Visual Studio 2012 Web Deploy whereby the deploy process always adds the connection string to the configuration file, even if you tell it not to. In my case, it was also adding in the wrong spot, which broke my application.
To fix the issue, I simply stopped using the attribute and turned off configuration inheritance using one of the options listed here.
I can now publish without errors, but the process still adds the connection string to the deployed configuration file. Annoying but not a show stopper.

ASP.NET ReportViewer works in development, is empty when deployed

I have a ASP.NET web app that utilizes ReportViewer to show local reports. Everything works beautifully on my development machine (XP Pro, Visual Studio 2008). When I deploy the app to the production server (Windows Server 2008, IIS 7), the site works very well, except for the report viewer. When I generate the report, the report viewer remains empty.
I have written debugging code to verify that the records are being received from the database, and they are. No error occurs but, no records are show in the report viewer. Also, the images that normally appear in the menu bar of the ReportViewer control (export button, print button, forward and back buttons, etc) do not load either.
I ran the ReportViewer.exe on the server to install the appropriate files, and I have verified that they are in the GAC of the machine.
Can anyone suggest a way to debug this...it would be easier if an error was being generated (I can't believe I just said that)?
Please verify that you have the required web.config entries. My suspicion is that you are missing the entry in system.webServer/handlers, which is required in IIS7. IIS7 pretty much ignores the system.web/httpHandlers section, which may explain why it works in IIS 5.1 (XP) but not in 7.
Version numbers may vary, but this should cover it for entries:
In the system.web/compilation section:
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
In the system.web/httpHandlers section
<add path="Reserved.ReportViewerWebControl.axd"
verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
validate="false" />
And in the system.webServer/handlers section:
<add name="ReportViewer"
path="Reserved.ReportViewerWebControl.axd"
verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
preCondition="integratedMode" />