Crystal Report Hangs/Freezed when Loading - asp.net

​Hi Everyone,
Currently i'm having trouble to solve an issue which caused Crystal Reports hang when loading process. Below are the scenario:
1. Basically, i've built an windows service to export Crystal report to PDF simultaneously
2. But some times when the service export the reports until certain limit, the service will suddenly Hang, meaning Crystal Report suddenly stuck in the middle of ReportDocument.Load() function, which caused i need to restart the service in order to let the service be able to load the report again.
I believed that i've put all the necessary codes to release/free memory resources which attached to the report object when the report is exported, such as:
1. reportDocument.Close();
reportDocument.Dispose();
GC.Collect();
But still, the issue has not been solved yet. I've did a lot of research and found that actually this problem is somehow related to the PrintJobLimit configuration, but before i change the configuration, i would like to know:
Is there any way except than increasing the print job limit can solve this issue ?
If increasing the print job limit is the only option, can anyone explain to me how does the print job limit works ? Is one page of report considered as 1 print job ? If that's the case, then why i can still be able to export a report that contains 100 more pages without any issue while my print job limit is 75?
Any advice from you will be very appreciated. Thanks.

If anyone faced the issue i mentioned above, can refer to below links, i've asked the SAP people, and i think they have a good answer about this.
https://answers.sap.com/questions/702435/crystal-report-hang-when-load-report.html

Related

CreateObject randomly fails since recent windows security update that does not seem related

We use MSWC.BrowserType (browscap.dll) in our classic asp website to help identify user agents.
Since July 21 our code began to throw Server.CreateObject failed errors when trying to create this object.
It works most of the time, but randomly fails several times each day.
I was on vacation when the problem began, I know we didn't change anything in our code or system configuration, the only thing I see is the windows update kb3079904 that was installed on the July 21, but it does not seems related because it is about font driver !?
I wonder if someone else have the same problem or have an idea how to solve it, I did some research about intermittent createobject failing but didn't find anything relevant.
I may try to restore the system to the checkpoint before this update to see if it is really the cause, but this is an important security update and I will have to re-install it after so it may not solve the problem.
It turned out to be related to this other post, object creation failed because the component likely uses the cookie collection.
Response.Cookies collection seems corrupted and causes error

crystal reports error when hosting on server

I have a web application which I developed which uses crystal reports for VS 2010. The reports work fine on my machine, but when I publish the web application, I get the following error when loading the report:
Error
This group section cannot be printed because its condition field is nonexistent or invalid. Format the section to choose another condition field. Error in File temp_9b46c401-8cdb-45a6-bade-4d3e37dda1fb {572D2B99-425A-4EC5-A758-6497001368A3}.rpt: Invalid group condition.
I've searched for this and from what I can understand it's a connection issue. But I've checked and the database connection string is fine. Other parts of web application work fine with it. Is there anything else I should be checking for?
I've resolved the issue. It was very frustrating and so I thought I should put this here in case anyone runs into this:
Make sure you have the same version of Crystal Reports Runtime installed on your server as on your development machine. I had 13.0.3 on my development machine and 13.0.1. on my server. Of course crystal reports gave an obscure error which makes it very difficult to know where to look.
After I did this, I kept getting a blank page. This linked help me resolve this issue: http://www.codeproject.com/Questions/287543/Crystal-Reports-not-rendering-when-webpage-is-serv. Apparently visual studio doesn't copy all the necessary files for it to render the reports.
Thanks.
I'm not so sure that the error is because of a database connection issue. If I were you I would look into a few things first:
Make sure that the database fields haven't changed. Is the application accessing the same database when deployed as it does in the development environment?
What about Null values? Have you checked the "Convert Database Null Values" in the Report Options?
What about the groups? Are there any formulas in them or are any of them based on groups? Browse the data to see if you get any errors.
Just because it runs on your development machine doesn't mean the problem isn't in the datasource. Maybe one of your report's formulas is expecting a field to be non-null, and there is a single null entry. Or a date somehow got entered as #01/01/9999# and a formula in the report is expecting a realistic date.
That should get you started and maybe even solve your issue. Give us some more info about the report and the datasource if you can.

Does nopCommerce have a log file? If so, in what location is it stored?

I have been waiting for nopCommerce to install for about half an hour now (onto a free tier AWS server) and I would love to see if the install is still going on or if it has crashed at some point.
Does nopCommerce output a log file that I could view with a tool like baretail?
First of all, NopCommerce's installation is a pain in the neck. It takes really long and no one knows if it is doing something. However, in my experience with NopCommerce, I have installed it more than 10 times and it has never failed. So, it is just a matter of waiting.
To reply your answer about the log, there is a SQL table "Log" that stores all errors, and also an option from the admin to view a report of this table. It is really good.
However, because NopCommerce is being installed and this table may not yet exist, you can also check the Windows Event log using the event viewer.

Is it possible to have the entire contents of a class that tripped an error included in the stacktrace?

A lot of time can pass between the moment a stack trace is generated and the moment the stack trace is thoroughly investigated. During that time, a lot can happen to the file in question, sometimes obscuring the original error. The error might have been fixed in the meantime (overlapping bugs).
Is it possible to get Stacktraces that show the offending file at the time of the error?
Not elegantly, and you normally don't want the user browsing through code that's throwing unexpected exceptions anyway (open door to an attacker).
Usually, what happens in a dev shop is that the user reports an error, stack trace, and the build it occurred on. As a tester, you can grab that build from your archives (you ARE keeping an archive of all supported releases somewhere handy, RIGHT?), install, run, and try to reproduce the error, working with the user to provide additional info as necessary. I've seen very few bugs that couldn't be reproduced EVENTUALLY, even if it required running the program against a backup of the user's production database to do it.
As a developer, you can download that build's source code from your version control repository (you ARE using version control, RIGHT?), and examine the lines in the stack trace to try to discover the problem by inspection, and/or build and run it to reproduce the error. Then, you go back to the latest source version, build, and run the same steps (a UI automation system can help out here), and if you don't get the error, someone else already found and fixed it. If you still get the error, you also got an updated stack trace with lines that match the current build, allowing you to set your breakpoints and step through.
What KeithS said, plus there are ways to capture more helpful state information at the time of the Exception using the Exception.Data property. See http://blog.abodit.com/2010/03/using-exception-data-to-add-additional-information-to-an-exception/
While KeithS' answer as pretty much correct, it can be easier and more elegant than you think. If you can collect a dumpfile (instead of just a stack trace), you can use a Symbol Server and Source Server in combination with your debugger to automatically pull your correct-version code from source control.
For example: if you enable PDB output and source-server integration in MSBuild, and upload the resulting PDBs to a symbol server, Visual Studio can automatically load the correct source control from a TFS or SourceSafe repository based on the information in a minidump.

Decrypting the YSOD, techniques to the mayhem

How many can relate do this?
Server Error in / Application
Object reference not set to an object
Description: Object reference not set to an object.
Exception Details: System.NullReferenceException: Object reference not set to an object.
Source Error:
Line 56: posts.Add(post);
On a more serious note, what are the first things you look for when you see the
yellow screen of death? Half the time the debug trace isn't actually telling you what the problem is (understandable I guess).
I must admit, I still use Response.Write more than I should. I just get lazy going through the debugger. What techniques do you use to debug the problem?
If I'm unable to identify/resolve the issue using the error message that the page presents to me, I will typically try to use the Windows Event Viewer to help me identify what is causing the issue.
For example, SharePoint errors are sometimes far less than descriptive. So, I'll combine what I'm seeing on the Y.S.O.D. with error messages from the Event Viewer to help me narrow down the cause.
I will do my best to ask a co-worker or other associate that I think might have some experience that might help. If I'm still unable to identify the cause, I will resort to Google armed with all the information.
Here's how I try to reduce the number of YSODs. One of the first things I do when starting work on an app is to create a custom exception class.
Add properties such as the SQL
statement being run. Two display
message text fields, one for display
to users, one for display to
developers (in debug mode) Who is
the logged-in user. Get all the form
variables so you know what they were
trying to enter.
Log the errors somewhere (event log
is good, if you can access the web
server; logging to the database is
less successful when so many
exceptions are inability to access
the database).
Create code in the MasterPage or web page base class Page Error events and Application Error events to do the logging.
Create a custom error page. When in
debug mode, the custom error page
displays everything. When not in
debug mode (production), display
only selected properties of the
custom exception.
Investing the time up front to do this will save you many hours of anguish later.
I usually do my debugging on my local machine with the Cassini web server (comes with VS 2005/2008). If I see an exception on my QA or, heaven forbid, my production box it's usually because I forgot to update my connection strings so that they point to the QA/production database instead of my local machine.
In other cases, I've found the stack traces to be very helpful in determining where to provide breakpoints so I step through it in the debugger and examine the data at runtime. The only time I've written any debugging information on the page was when trying to find some performance issues that I couldn't replicate on my developer instance. In this case I wrote some hidden fields that contained timing information about various parts of the render process.
the error info provided, assuming you are in debug mode, will give you information as to what line the error actually occurred on, along with the lines of code leading up to the error. This info should give you a good start on defining where to set your break points for debugging.
I was once in your shoes many moons ago, using response.write for debugging. Once you start using the IDE and debugger as it's intended you'll find yourself pulling out less hair and getting to the solutions much faster.
Also, opening up the immediate window while debugging is gonna make your life even more happy.
Use a decent logging framework such as log4net, and be liberal in your use of DEBUG-level logging.
It's essentially a neater version of your Response.Write approach, which can be left in your production code and "switched on" when required.

Resources