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!

Flag changes in colour for Audit report

Status
Not open for further replies.

mart1000

MIS
May 23, 2007
39
GB
I have a report as below


Group1 - Action Shows Field headings

Group2 - Batch Hidden

Detail A Before data

Detail B After data

I have grouped each transaction by its batch no (before and after in effect)

Each transaction before and after has the SAME id and there are NO other IDs except a before and after flag. The report is fine. I can show the detail for before on detail A and after on Detail B.
My issue is I have about 20 columns and only one may contain a change of data. I thought it would be nice if I could either flag up the change in red on the after data field or on the field header

How can I do this, does it involve variables etc?

Confused how to do this. I need a simple method has have many fields and about 20 reports looking at different tables so want to minimise work if possible otherwise I may abandon my idea
 
What version of crystal?

Also details B is ambiguous - is this a separate details section in your report? Or is it the 2nd record of your report?

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
 
Right-click, choose Format Field. This should include a test for colour. Tests can include a reference to Previous or Next.

Depending on your Crystal version, you might also be able to change the colour of the section.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sorry , yes of course I forgot to say. Its old version im afraid of 8.5

Detail B is inserted detail which shows the second part of transaction when a deal is changed ie "After"
 
To Madawc

Yes Ive used conditional formating a lot etc but I think this is more difficult as the data is grouped by batch which essentially groups the before and after states of a transaction which unfortunately is only capured by one unique no. So I am showing the before and after states on detail A and Detail B sections and want to show how if a field in section B differs from same field in section A by either changing the clour of field in section B or the header title for that field
 
You can save values in a variable.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
So is "the second part of the transaction" a separate record in your database, or different values of the same record in your database?

"Details b", as a common crystal naming convention, typically refers to the latter, but I want to make sure you understand this before I give you an answer.

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
 
Different values of the same record in effect a before and after image of transaction which I distingish by a transaction flag and you can also tell by time update

If the answer is variables I m worried as never used before and think this may be a lots of work on each of 20 reports which look at different tables
 
Variables will not be necessary, but there is no need to be afraid of them.

If you really are doing this as one record of the database, right click on the field you would like highlighted and select format field. Click on the background color tab and then the X-2 button and enter a formula:

Code:
If {YourField}<>{Fieldforoldvalue} then yellow else nocolor

If this is, as I suspect, actually 2 records in your database, you will need to use a formula like this instead:

Code:
Not OnFirstRecord;
If {YourField}<>Previous({YourField}) then yellow else nocolor

If neither of these work, then post some sample data and indicate what type of database you are using.

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
 
Thanks Dgillz, you were correct it was your second solution. I will now go through the ball ache of formating all the fields!

 
Dgillz

Mmm I still have one problem, I need to reset somehow when the first record starts!

I need it to just look at last 2 records as allways just 2 records in a batch, before and after 'images':


Group1 - Action Shows Field headings

Group2 - Batch Hidden

Detail A Before or After data text

Detail B Shows the field data

eg Group 1 Trans no Bus Unit

Group 2 Updates Batch

12345 1
124 1

12345 2
125 1

In example above it must allways be the 2nd line that flags up. I have also modified your formula as Bold required not Red:

Not OnFirstRecord;
IF {JNJ_F0101_Audit_File_(A570101).Transaction Action (AB57TACTN)} ="U" then
If {JNJ_F0101_Audit_File_(A570101).Address Number (ABAN8)}=Previous({JNJ_F0101_Audit_File_(A570101).Address Number (ABAN8)}) then crRegular else crBold

 
Dgillz

Think I sorted it. I have put a running total in and tested the value 2. this appears to work thank God. I will have to put this sort of thing into abbout 300 fields across 20 reports now!!!

If ({#RTotal0}=2 and
{JNJ_F0101_Audit_File_(A570101).Transaction Action (AB57TACTN)} ="U") then
If {JNJ_F0101_Audit_File_(A570101).Business Unit (ABMCU)}=Previous({JNJ_F0101_Audit_File_(A570101).Business Unit (ABMCU)}) then NoLine else SingleLine
 
What field are you grouping on? There may be away to make your formula work easier for multiple fields.

Specifically, look at the CurrentFieldValue function

If CurrentFieldValue=Previous({YourField1}) then....

This formula can be copied to other fields' formatting formulas and you would only need to change the stuff in bold.

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
 
Thnaks, but as above I am grouping on transaction action and when = U only (ie update not deletes or inserts) then I need formula to work. My second groping is batch which contains the before and after 'view'. I will look at your idea though
 
What I am saying is to try this:

If ({#RTotal0}=2 and
{JNJ_F0101_Audit_File_(A570101).Transaction Action (AB57TACTN)} ="U") then
If CurrentFieldValue=Previous([red]{JNJ_F0101_Audit_File_(A570101).Business Unit (ABMCU)}[/red]) then NoLine else SingleLine

You can then copy this formula to every field and only replace what is in red above, rather than replacing both sides of the test.

If only Previous(CurrentFieldValue) would work!

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