Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Report builder Enterprise 7.04

edited June 2004 in End User
A problem reported in 7.03 related to the logic of comparing field values
have been carried forward to 7.04.

The problem is in the code that compares string values of Variants which
contain International characters. Then AnsiCompareString function simply
does not work with variants properly with the International characters in
string values.

In ppdb.pas "function TppCustomDataPipeline.CompareLinkedData: Integer",
following code does not work properly:

else if ((VarType(lMasterFieldValue) = varString) and
(VarType(lDetailFieldValue) = varString)) or
((VarType(lMasterFieldValue) = varOleStr) and
(VarType(lDetailFieldValue) = varOleStr)) then
begin
if lFieldLink.IsCaseSensitive then
begin
if (lFieldLink.CollationType = ctANSI) then
Result := AnsiCompareStr(String(lDetailFieldValue),
String(lMasterFieldValue))
else
Result := CompareStr(String(lDetailFieldValue),
String(lMasterFieldValue));
end
else
begin
if (lFieldLink.CollationType = ctANSI) then
Result := AnsiCompareText(String(lDetailFieldValue),
String(lMasterFieldValue))
else
Result := CompareText(String(lDetailFieldValue),
String(lMasterFieldValue));
end;
end
=========================================================================
The following user supplied code works properly all the time:

else if ((VarType(lMasterFieldValue) = varString) and
(VarType(lDetailFieldValue) = varString)) or
((VarType(lMasterFieldValue) = varOleStr) and
(VarType(lDetailFieldValue) = varOleStr)) then
begin
if lFieldLink.IsCaseSensitive then
begin
if (lFieldLink.CollationType = ctANSI) then
begin
if VarCompareValue(lDetailFieldValue, lMasterFieldValue) =
VrEqual then
Result := 0
else if VarCompareValue(lDetailFieldValue,
lMasterFieldValue) = VrLessThan then
Result := -1
else if VarCompareValue(lDetailFieldValue,
lMasterFieldValue) = VrGreaterThan then
Result := 1
// Result := AnsiCompareStr(String(lDetailFieldValue),
String(lMasterFieldValue))
end
else
Result := CompareStr(String(lDetailFieldValue),
String(lMasterFieldValue));
end
else
begin
if (lFieldLink.CollationType = ctANSI) then
begin
if VarCompareValue(lDetailFieldValue, lMasterFieldValue) =
VrEqual then
Result := 0
else if VarCompareValue(lDetailFieldValue,
lMasterFieldValue) = VrLessThan then
Result := -1
else if VarCompareValue(lDetailFieldValue,
lMasterFieldValue) = VrGreaterThan then
Result := 1
// Result := AnsiCompareText(String(lDetailFieldValue),
String(lMasterFieldValue))
end
else
Result := CompareText(String(lDetailFieldValue),
String(lMasterFieldValue));
end;
end

The fix was submitted to Digital-Metaphors a long time ago and it was said
"It will be included in the next maintenance release".

I was forced to patch the ppdb.pas file one more time to take care of the
problem. This was not appreciated at all.

I am submitting the fix in public here so that other people in my situation
can perhaps benefit from it.

Regards,

Comments

  • edited June 2004

    Sorry for the misunderstanding. To clarify, I stated

    'We can add a new collation type to a future release..'

    There are currently two collation types: ctASCII, and ctANSI. I proposed
    that a third collation type be added - ctVariant. This enhancement however
    did not make it into 7.04. The enhancement is still on our list of to do's.
    ReportBuilder 9 would be the likely release to include this enhancement.
    Thanks for your patience and understanding.


    --

    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com


  • edited June 2004
    Dear Nard,

    There is certainly a difference between an enhancement and a bug fix. Your
    current code does not work, you need to fix it first.

    Aydin Odacioglu
    DBI YAZILIM

    "Digital Metaphors" , iletide ?unu yazd?
This discussion has been closed.