Solved

Adding SQL database queries to a Crystal report

Posted on 2008-10-06
3
203 Views
Last Modified: 2012-05-05
Hello,

I'm working on some maintenance of a Crystal report that was built with a html front end.

I'd like to make my addition by adding a sql query to the report file itself and not have to do any work with the html feed of data into the report file if possible.

Does Crystal have a good way that I can use the ODBC data source the report already uses and add a SQL query that I can store the result in a formula I create within the report or am I simplifying this too much??

Thanks,
JMO9966
0
Comment
Question by:JMO9966
  • 2
3 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 22652001
Crystal can only use a single query as the data source.

You could use a subreport and pass the information to the main report using shared variables.

If the main report is using a SQL database you may also be able to use a SQL Expression in a formula to get the value.  A SQL Expression can only return a single value.

mlmcc
0
 

Author Comment

by:JMO9966
ID: 22653387
Thanks mlmcc,

I also need to pass values from the report into my sql query.  What are your thoughts on that?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22654676
If you use it as the source of a subreport you can pass aprameters to the query.

You can also use the seelct expert to filter the data for the subreport.

You can also use the SQL expression with data in the report as filters.

mlmcc
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question