How to find all fields being used in my Crystal Reports from SQL? - sql

I'm trying to clean up my SQL database and find out which fields are not being used. Is it possible to find all fields from SQL that are being used in Crystal Reports without manually looking in each query?
Thank you!

Related

Crystal reports: Can I have my own query

This is probably silly but I need to get this question out of the way. I am new in Crystal Reports, thus the ignorance. I would like to know if somehow is possible to select the database in the crystal reports with all of the tables etc. and then instead of selecting tables from the Database Expert, to write somewhere your own query. I am thinking something like the SQL Developer but in CR.

SSRS - Table of Expressions

I'm not that experienced in sql server and even less so in using SSRS. I'm working with 2008 R2 edition.
Question: Is it possible to use a sql table that has expressions in a report, so that the report will evaluate the expressions before it is run? I just tried and the expressions don't get evaluated and show up as string. The expressions are stored as string in the sql table. Not sure if there is another way to store the expressions?
Thanks in advance for your help.
Cheers,
In SSRS, it sends the query to database engine and execute. Once the data is retrieved from database, the data is fixed. Then report will process the data and render it. And the query is executed only one time. You can't make the query re-process the expression within the cell again.

Add exsiting query to report

My report calculates the stock of inks in my stores. I built a SQL statement in VB.NET and got the correct results. How can I display these results in my Crystal Report? Or design a report such that same results will be retrieved?
I tried to use SQL Expression builder but failed.
Usually you will link Data Tables to your report using Database Expert. Do the same in Database Expert, select the Database and you can see Add Command. Select that and click the > button. You will get a Window, write your SQL Query there and press OK.
After finishing this you can see Command in Database Fields which contains all your records got from the SQL Query as result.
In Database Manager choose Add Command and then type your SQL Statement there.

How can use rdlc report with Oracle procedure?

Can any one help to solve creating reports of rdlc using Oracle stored procedure.
RDLC accepts object (POCO, StrongTyped DataSet, ...) as data source. So it doesn't matter where data source comes from.

Crystal reports not pulling same data as sql server

I have the following code:
select order_number,received_date
from order_head
where order_head.order_number not in (select order_number from csa_log group by order_number)
and ordernature in ('02','03')
and received_date > '01.01.2010'
and buyer_code = 'GAP'
group by order_number,received_date
order by received_date desc
When run in crystal reports does not pull the same data as sql server express. It is pulling only one record as opposed to 7. Anybody have some insight? Thank you in advance. (I have a suspicion it has something to do with the nested statement).
Several possibilites come to mind.
First are you absolutely sure that Crystal Reports and the database you are querying are the same one. Amazing how often one is querying dev and another prod when you have these kinds of issues. Even if you don't believe this to be the case, check this anyway.
Permissions could be another reason for the discrepancy.
Finally confirm that the two queries are exactly the same. Use Profiler if possible to confirm this.
Usually I use SQL server profiler to check what SQL Statements Crystal is running behind the scenes. In your case is not possible because you are running SQL Server Express.
In Crystal you have the option of checking the actual SQL statement that Crystal is running by selecting "Database" and "Show SQL Statement" in the top menu.
Make sure that under Reports menu you are not putting any conditions in the Select Records.
Check that you are showing the fields in the detail and not in the header or footer. That is a common mistake.