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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to suppress using Conditional formatting

Status
Not open for further replies.

ZosMo

IS-IT--Management
Oct 13, 2004
2
GB
Hi,

I'm new to this forum, but sadly a CrystalReports user for a number of years who thought he was doing quite well, but...

I'm putting together a standard (and simple) report which has just one grouping based on a "PLType" field I've created, and each transaction will have it's own PLType value.

The PLType field will contain either a:

001, 101, 201, 301 or 401

And the report will group the records based on this text value, and produce a sub-total for each group.

But not every instance will be reported as some records will be excluded based on other criteria. For example, my report might only contain groups 101, 201 & 401 or maybe just 001, 101 & 201 etc

The problem is I need to display a running total of all records from 001 to 301 inclusive, to display the total, called "Contribution" after the last of these groups shown on the report, and before the 401 group (if it exists in the report.

If it makes a difference, the data is SQL.

Help ??




 
It would be very helpful to know the following so we can provide the proper answer based on the Crystal version you are using. Based on what you provided, we can only guess on what you need.

Crystal Version
Database
Connectivity
Sample data
Expected output

If there is a table that defines the PL Type, then use a left outer join the the data table linked by PL Type and do your grouping on PL Type.

 
You could try the following.

Return all of your records to the report. Then create a formula for your group.

@Group1 for example.

Within @Group1, perform you conditional evals and then insert your group based on the results of @Group1. I do something similar all the time.

It would help to see some examples and what conditions need to be met.

James
 
Do you mean that you want a zero total for groups that are not reported on a particular run? One solution is to include a wider range of date in your data, one that will include something for every vendor. Then suppress printing for those outside of the date range, showing just the group header or footer. This is an inefficient use of machine-time, but might be the simplest solution from your point of view.
Another way is to create running totals for all possible vendors. Show them in the report footer when the total is zero.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
I do something similar all the time.

The trick is to group based on the result of formula's rather than record exclusion based on condition (if that makes any sense).

Basically, you return all of the records to the report that you may need.

Create a formul named Group1 (or whatever you want)
and do you conditional evals within that formula. When you insert your Group, you simply select the Group1 formula, rather than some data field and away you go.

The evals might look something like this

if {condition1}="blah" and {conditional2}="blahblah then "101" else
if{you get the idea} then "102"

and so on.

As wichitakid states, some data and conditions and environment info would be helpful.

James
 
Try creating a formula called @Contributions:
If PLType in ["001","101","201","301"] then
1 else
2

Group your report by @Contributions and then group by PLType.

Add your totals to the @Contributions group footer which should total all records from 001 to 301 and then 401. You can suppress the group footer for @Contributions when the value is 401 if you want.

Mrbill
 
Don't exclude records in your record selection formula. Instead, suppress the PL Type group headers/footers and details you don't want displayed using the section expert with a formula like:

not({table.PLType} in ["001","301"])

Then you can use either a formula like:

If {table.PLType} in ["001","101","201","301"] then
{table.amt}

...and insert a grand total on it or insert a running total and in the evaluation section choose "use a formula" and enter:

{table.PLType} in ["001","101","201","301"]

Reset never.

-LB
 
Hi, thanks for the reply.

I hope this gives you an idea of what I need.

the data shown is in gf1a and I've inserted a new section below it (gf1b) and inserted the running total formula to calculate the "DivContr"


Version: crwv10

SQL database (sage Line200)
ODBC dsn linking crw to sql_server 2000


Period YTD

001 100 500
101 200 700
201 400 900
301 200 600
------------------------
DivContr 900 2700

401 1000 3000
============
Total 1900 5700



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top