Skip to Content
avatar image
Former Member

2 charts with different queries referencing same DB on same report?

I am trying to generate a report, which contains 2 line charts running 2 similar queries that reference the same back end database. The purpose of these queries is to generate performance metric data for a large # of servers, so effectively I have the first query showing the performance data for group A, and the other query showing that same performance data, but for group B. I know this capability is available within subreports, however since these reports are going to be customer facing keeping them organized and evenly spaced is a concern. Some of these reports will have 4 or so databases, and from my brief experience in Crystal, and from using Ireporter, trying to evenly space graphs that are contained within a subreport can be very difficult and imprecise.

For what it's worth, I set the database connection up as an OLE DB, and was able to add both queries in as commands. However when trying to add another chart to report that utilizes a different command, Crystal reports just seems to freak out and basically run until it crashes. I'm not sure if I set the DB links up properly, but I both left it as is and unlinked the DBs, with similar results. This is a MS SQL 2014 DB.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 31, 2017 at 05:34 PM

    Hi Chris,

    Crystal can't properly manage two queries in the same report. It can only work properly with a single result set, which is why subreports were created.

    I've seen what you are attempting to do work but the results are unpredictable and I would not recommend it. If you do want to go down that road, it's easier if you use stored procedures instead of queries and push as much processing to the stored procedures. The less Crystal has to do the less confused Crystal will be.

    That being said, it pushes the boundaries of Crystal's capabilities. Like trying to give a cat a bath. It may do it but not without consequences.

    Good luck,


    Add comment
    10|10000 characters needed characters exceeded

  • Apr 03, 2017 at 08:30 AM

    Why not use a single command and then UNION data.

    Add a Dummy field called REPORTTYPE and in first query Call it ReportA and other union REPORTB

    Then group on this field and place charts in the header.


    Add comment
    10|10000 characters needed characters exceeded