Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Remove Reports Fields....

Status
Not open for further replies.

mrkan

Programmer
Oct 30, 2006
39
US
Two questions:

1) I am updating some old reports and can't figure out how to remove reports fields. Let me explain:

When you are creating report first time, you are asked to choose tables, then in the second step you select fields to be used in report. Let's say I have fileds a,b,c,d,e,f in my report. How can I later on remove field b from report if I don't need it?
For several hours now I am trying to figure this out.

2) In the select expert I have something like this:

Month({fld_date}) > 10 and
Month({fld_date}) < 12 and

When I run report I see that above two lines are ignored and when I click Show SQL Query I see that these two lines are omitted... No warning... nothing at all....

What's wrong?

I am forced to use Crystal since version 9. I am on "greatly improved" version IX now.

Thanks...
 
So what makes you think you need to remove a field? Surely not the "show SQL query". What is your report not doing that you want it to do?

Please post current results and desired results.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Choose Report > Selection Formuals > Record, or whatever variant you have on XI. You should see the code references and can remove them there.

Crystal doesn't generate SQL commands for all of the selection rules. Those are the selections made by the server before it sends the data to your machine, which may then do extra selections of its own. In some cases you can speed a report enormously by re-writing the selection in SQL.

Record fields will be shown as used if they exist in a Formula Field or on the screen. Check the Field Explorer and you may find that some of them are not in use.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks, both...

In the report, I want to show only DISTINCT records..

Example:
select distinct a,b,c from mytable where d=1

In Crystal, a, b and c are field shown on the report (so called: report fields).
In the select expert I would have:
{d} = 1

The problem is, Crystal thinks that field d is part of my report(because it is in the select expert) so, I believe resulting statement that is run in crystal would be something like:
select distinct a,b,c,d from mytable where d=1

I don't want "d" in select statement, it affects my result.

The solution would be to be able to run SQL statement instead of using Select Expert. Can you show me how to do this?

Another option is to create view on the server with my SQL statement, then use that view in Crystal (I am trying to avoid this since I don't have direct control over sql server. My DBA has.)

2) And second thing. This doesn't work in Select Expert:
Month({fld_date}) = 10
This statement is simply being ignored.

but this works:
ToText({fld_date}, "MM") = "10"

It would show me all records from month October.

Then if I would like all records after October I would have to do something like:
Val(ToText({fld_date}, "MM")) > 10

It looks extremely strange to me.
 
As madawc says,not everything in a record selection formula translates to SQL.

Please post your record selection formula (not the sql or the select expert), your current results and desired results.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top