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

Boolean Required Problem

Status
Not open for further replies.

azwaan

Programmer
Jan 11, 2002
42
I have two Applications which uses Crystal reports, one developed using a version prior to version 7 and one using 8.5

the one's developed using the old version compares bit data type field (boolean on SqlServer DB's) by comparing against 0 or 1. for example


present=0 or present =1 (Present is of bit data type)

the newer version does not support this according to the Crystal support web site..and must be compared using

present=false or present =true

now the problem is how can i view both the old and new reports on the same machine?

the reports are really complex ..and this comparsion is very central to the reports and is used in more than a dozen formulas & other fields.

is there a work around for this?


 
You have workarounds.

Create a SQL Expression to convert the boolean to a numeric as in:

case Present when 1 then 1 else 0 end

This gets processed by the database so the performance is great.

Or you can create a formula field within Crystal to use as your compare, as in:

if {MyTable.Present} = true then 1 else 0

and use this formula for the comparison.

The way I would likely handle this is by using a View instead of the underlying table for all reports.

This gives you a layer of insulation wherein you can recode the View if the underlying table structure changes, or a more recent version of an application requires modifications, as in your case.

-k kai@informeddatadecisions.com
 
I don't remember if 'yes' and 'no' is accepted in v7 as an alternative to 'true' and 'false'. You might want to find out. If it is, you can replace 1 and 0 and true and false with yes and no across the board.

Naith
 
well , it's really a shame that crystal hasn't heard of backward compatibility...

now i will have to change all my reports , which are over 40 in number..with each report having more than a dozen formula fields related to this issue.. ..!

and that doesn't stop there...clients still using the old activex control will still require the older reports for it to run. which means i will have to keep 2 versions of each report.

 
Before you go ahead and do all that, exhaust the less painful possibilities first.

Contact Crystal Decisions and find out if there is already a ufl you can download for this. This issue has been raised before (ID 20784 on their website), so find out if they have resolved it yet.

Alternatively, you could create a dll which would enable you to recognise the full consortium of boolean values, which should make it unnecessary to maintain a duplicated report suite.

Naith
 
If you do have to rework all of your reports, change them to use Views based on the tables, that way if something changes in the future you can just alter the View and not have to touch the reports.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top