Crystal reports display a blank page in C#, asp.net - c#

I have a website in vs2008. I have created a crystal report which works fine in the DEVELOPMENT environment. But when I publish my website to IIS, the report is never displayed. It just displays a blank page. Can anyone tell me how to resolve this issue?
Thanks

If you installed your application in a website different from Default WebSite, try this:
Solution
Copy aspnet_client folder from c:\inetpub\wwwroot folder to the new website root folder.
or in IIS:
Create a virtual directory called aspnet_client that points to c:\inetpub\wwwroot inside the new website.
Cause of the problem
Using client tools (debug window of your browser) or server tool (IIS log) you will find that some required Crystal files like crv.js and style.css are not served. That's because these files are placed by CR installer in wwwroot\aspnet_client folder, but they cannot be reached from other websites installed on the same machine.
I can see that you use different versions of software and different configurations, but I think you have the same problem.

Make sure Folder "2_0_50727" exists at C:\inetpub\wwwroot\aspnet_client\system_web
or your SiteRootFolder\aspnet_client\system_web
if not exists copy the folder "4_0_30319" as "2_0_50727".

If you are using Submit button for viewing the report, make sure you effect a full postback on submit button click. You will find that all pages in the report will work perfectly fine.
Note: Use Trigger with Update Panel to Effect the Full Post Back (The Control ID of the trigger should be the ID of the button).

Perfect! The solution is to work on IIS this way:
Copy aspnet_client folder from c:\inetpub\wwwroot folder to the new website root folder.
OR
Create a virtual directory called aspnet_client that points to c:\inetpub\wwwroot inside the new website
Thank you so much

You need to install the merge modules on the web server. You can download them from Here

Check the Crystal Report Run-time version, for example if you install version 13.0.1 and your Visual Studio uses 13.0.2 the report will display but not data will be displayed.

Related

FontAwesome files not published to the web server

I'm using fontawesome in one of my web applications. The problem is that not all of the fontawesome files that is contained withing my Content folder is published to the web server.
Is there any way that I can get these files to be published without having to manually copy them?
Please check the following.
1) check if the font files are in your project in visual studio (i.e. event the files are in the the project folders in Explorer doesn't mean it is in visual studio project, see if you can view it in your solution explorer)
2) if you can see it in your solution explorer, right click on it and see if you see an option called Include In Project. if you see this, click on it and it will include the file into your project. Instead, if you see Exclude from Project then it's in your project.
3) right click on the font file again and see if the Build Action property is set to Content.
This actually had nothing to do with the files not deploying. I'm using bundling and minification and unfortunately it seems that MVC bundles are not smart enough when it comes to virtual directories.
A quick fix was to create a physical directory with the files giving me a 404 error.

Images don't show up after VS 2012 Publish

I have created asp.net web project. I have included some files in this project. Following all CSS standards required.
background-image: url('~/Images/sideheader.png')
I can see all pictures when I debug my site. But when I publish my site, I don't see any picture in my site.
Please help me resolve this problem.
When you manually add files (i.e. images/js/css) to a directory and use them directly in your html/css (as per your question) Visual Studio does not know they exist. You need to 'show all files' and then 'include in project' the images/files you want to publish.
Only the files which are visible (=included) in the Solution Explorer in Visual Studio will be published to your server.
You should use it like this :
background-image: url('/Images/sideheader.png')
in this way the relative paths resolves to the correct place .
Your URL isn't pointing to the file. It works fine on the debug server, because when you run it in debug, it starts up a testing server for your project that has a different configuration than the server you published to. Because you have it in a different directory, or have a different home directory configured, it can't find the image.
For anyone coming to this question, this was determined from testing if replacing the relative URL with an absolute one would solve the problem, which took place in the comment section of the OP.
You just need to add your folder images to your project and republish your project. To add the folder, go to solution explorer, click on show all files, right click on your images folder and select include in project. You don't need to change any urls of the images you have used in your css or any where else.
I ran into the same issue, in my case since the Images folder is not recognized by Visual Studio, I had to set read permissions to everyone. Once I set the Image folder permissions, my images showed up just fine.

Prevent delete user generated content on visual studio 2010 publish

I have an application that stores images uploaded by user. Those images goes to content/images/upload. Problem is that if i published without the skip extra files on destination, all user uploaded content gets deleted. Im pretty sure im doing it wrongly, which would be the best approach for this situation ?
im worried about losing user generated content this way misconfiguring an option in publish.
One approach I've used is to move the physical path of the "upload" older outside the application folder structure. I'd use an IIS virtual directory to mount the folder to the application. For example, if the folder structure currently looks like this:
c:\inetpub\
wwwroot\
content\
images\
upload\
You might change it to this:
c:\inetpub
upload\ <-- must be manually created on the web server
wwwroot\
content\
images\
You'd remove the upload folder from the web application in Visual Studio. Log into the webserver and create the folder under inetpub (could go anywhere, really). Then go into IIS manager and create a virtual directory called upload that points to the c:\inetpub\upload folder.
The upload folder is no longer part of the Visual Studio project so the "publish" feature won't touch it.

JuiceUI implementation on a Virtual Directory in IIS

General Description :
I have installed JuiceUI on a local build of a web form application in asp.net in Visual Studio 2010. What I want to do is take this application and add it to a virtual directory that has been setup for me. I have JuiceUI working on my local version, but it does not load the AJAX (such as the datepicker [i.e. calendar]) on the virtual directory.
Any help to get this loaded onto the virtual directory would be very much appreciated.
Details I know to give at the moment :
This is a web form application. To deploy to the virtual directory, I copy and paste the directory of my code into the directory space on the server. Therefore my bin folders and jquery are loaded on my app folder. I have configured the parent website web.config membership provider so that I can connect and access my app.
So I have had my page working just fine on the virtual directory. I installed JuiceUI on my local build and was now copying it to the website to realize that none of the ajax functionality was working.
I'd say the first step is to verify that the browser is loading the necessary js and css files. Use chrome inspector or firefox+firebug and look for any 404s on the resources. If the scripts and css aren't loading, then you'll need to adjust their location in code to match your setup.

Crystal Reports for Visual Studio 2010 Error

I am trying to run a crystal report from my web application which was built using ASP.NET 4.0 and Visual Studio 2010. I have installed the following from the SAP site (http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp)
1) SAP Crystal Reports, version for Visual Studio 2010 - Standard EXE installation package which installs the software into the Visual Studio IDE.
2) SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)
I have a page called Reports.aspx in which I have a crystal report viewer control
<CR:CrystalReportViewer ID="rptViewer" runat="server" AutoDataBind="true" />
In the Reports.aspx.cs file I have the following code:
protected override void OnPreRender(EventArgs e)
{
ReportDocument report = new ReportDocument();
var path = Server.MapPath("Reports/Sample.rpt");
report.Load(path);
report.SetDatabaseLogon("username", "password", "servername", "databasename");
rptViewer.ReportSource = report;
}
On the report.Load(path) line I get the following error:
Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
How can I fix this?
I also got into the same problem my problem was report path was not valid, May be you have same problem , check Server.MapPath("Reports/Sample.rpt") returning valid path ?
make sure the report is in app_code folder
initialize a new instance of it instead of initializing a reportdocument and loading the report in it.
Sample report = new Sample();
this worked for me
You will need to modify two properties in the .rpt files:
Build Action is set to "Embedded Resource" by default. Change it to "Content".
Copy to Output is set to "Do not copy" by default. Change it to "Copy always".
Rebuild, Build deployment package and Publish. Done!
NOTE: Below, the term "WebSite" refers to actual web site nodes in IIS, NOT a virtual directory within a web site.
Problem Root Cause: There is no "aspnet_client" folder accessible by the application.
This can happen for several reasons:
Since the SAP CR installer appears to install the aspnet_client folder in the ...\inetpub\wwwroot\ folder, if your Web Site physical path is NOT ...\inetpub\wwwroot, your application will not have access to the aspnet_client folder.
If the aspnet_client folder was moved or deleted from to the top level of your web site's physical path, your IIS application will not have access to the folder.
Problem Solution (For Windows Server 2008 R2)
Go to the IIS manager on your server
Expand the tree view node for the WebSite running your application
Look at the level immediately under the web site node and ensure you see a "aspnet_client" folder.
If you do see the folder, then perhaps this root cause is not the cause of your problem.
If you do NOT see the folder, search the server's hard drive for it and COPY it to the Web Site's Physical path.
Right mouse button click on the Web Site node and click Refresh from the popup Menu
You should now see the aspnet_client folder at the level directly under your web site node and the reports in the application should work.
I ran into this when I converted a web site to a web application. The report would run fine on my dev machine, but not on the server. Then I realized the rpt file was missing on the server!
By default the report files were considered embedded resources and were not copied when the web application was published. I just changed them individually, republished the site, and all was well again.
I have also had a report load failure if I have mistakenly left the report file open in crystal reports designer.
This error is a real treat, and seems to have many possible antecedents. Fortunately I only wasted a day on my particular variation:
ReportDocument.Load() also makes a local temp copy. (This may only be in the case of a load from a network drive location, I didn't test this in the case of a local load.)
If the user context under which the load occurs does not have authority to create the temp file locally, Load will fail with the same very unhelpful error.
Also, I ended up diagnosing this with Process Monitor. It may be helpful for you as well.
Please make sure your report rpt files are in their original folder. I got the same error first, after I "published" my MVC web site to IIS. I didn't realize that "Publish" didn't put rpt files in the package.
Re-install the "Crystal report engine" to the server
Build Action set to "Content".
It perfectly worked for me..!

Categories