Print Page | Close Window

Find difference betwn rows and change Font color

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=730
Printed Date: 04 May 2025 at 6:26pm


Topic: Find difference betwn rows and change Font color
Posted By: CrystalBoy
Subject: Find difference betwn rows and change Font color
Date Posted: 22 May 2007 at 4:37pm
Hi,
 
  I am new to crystal reports.I am trying to create a report in which i will be comparing records from 2 different tables and will be displaying record from both the Databases simultaneously.
 
  The issue is i need to highlight the columns which is different.For example
          Id   Name    Location     Gender   
Row1  1     Jazz       US             Male
Row2  1     Jazz       UK             Male
 
I will be comparing both the rows and wherever i find a difference i need to changes the font color.
 
 
Thank you
 
 



Replies:
Posted By: GuestX
Date Posted: 22 May 2007 at 5:40pm
right click on label that will have value that can have differend colors
/format field/font/click  script button(x+2|pen)
and script would be something like:

if Table1.Location<>Table2.Location then
crRed else
cdBlack;

I didnt test it.


Posted By: RobV
Date Posted: 23 May 2007 at 1:29am

Hi,

The alternative to using formulas is to add a second details section.And drop Table1 into D1 and Table2 into D2.
 
See http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=693 - http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=693  for info on how to do this.
 
This will allow you complete formating and editing control over both tables without cluttering your report with formulas.
 
Take it Easy
 
RobV


Posted By: CrystalBoy
Date Posted: 23 May 2007 at 11:36am
Thanks,But after adding two section how do i do the formatting.I was planning to use a view which will have all the data .For Example
 
          Id   Name    Location     Gender   
Row1  1     Jazz       US             Male
Row2  1     Jazz       UK             Male
Row3 2     Tod         IND            Male
Row4  2    Tod         IND          FeMale
Row5  3    Mean       US             Male
Row6  3   Meany      UK             Male
There would be exactly 2 records for an id ,one from both tables.
Please advise.
 



Print Page | Close Window