Tuesday, February 21, 2012

Report generates incorrect results

Hey, after tinkering around with this VB 2005/Crystal setup for a while, I finally narrowed down the issue with the problem I'm having.

Using the SQL query Crystal gives me, I am trying to use VB.NET to pull data from a DSN server and into a DataSet, which I am trying to merge with the rpt file using the report.SetDataSource option. The problem is, with that particular query, the results generated pages in the report in the THOUSANDS. Typically, this report never goes over 10 pages. The thing is that when I generate the report within Crystal itself, it's fine... 10 pages or less.

After some fooling around with the VB code, I found that the problem was in the query! It seems that when I pull certain fields and inject them into the report, it systematically loads every possible value from those fields into each group (company tickets), and with so many fields this happens with, there becomes a compound effect. So what was 50+ bloat pages then becomes thousands.

I am wondering what the issue could possibly be with the query Crystal gives me (which works in Crystal) that when I try to bind the same data from a DataSet with the rpt template, it inflates the report with garbage data. Anyone have any similar occurrances or suggestions?Bump|||Maybe is how Crystal evaluates the records (whilereading, beforerading??) or maybe somehow one field was moved a detail section and before was on a header. I assume queries are the same...

Robert

No comments:

Post a Comment