Riz
Riz

Reputation: 6676

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?

Upvotes: 0

Views: 2400

Answers (2)

Riz
Riz

Reputation: 6676

I've resolved the issue. It was very frustrating and so I thought I should put this here in case anyone runs into this:

  1. 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.

  2. 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.

Upvotes: 1

campagnolo_1
campagnolo_1

Reputation: 2750

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:

  1. 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?
  2. What about Null values? Have you checked the "Convert Database Null Values" in the Report Options?
  3. 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.
  4. 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.

Upvotes: 0

Related Questions