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

Exception: "Could not convert type (String) into type (Double)

edited November 2004 in General
Hi,

here is the problem : I'm loading a report template, I'm trying to
print-preview it using ppReport.DeviceType := dtScreen and ppReport.Print;
But, an exception occurs:

"Can't execute program : Forcustdiscount1OnCalc
Could not convert variant of type (String) into type (Double)"

Here is the code in my Forcustdiscount1.OnCalc :

===================================================
if Report.DataPipeLine['CUSTOMER.DISCOUNT'] <> 0 then
begin
if Report.DataPipeLine['CUSTOMER.DISC_TYPE'] = '1' then
begin
Value := Report.DataPipeLine['CUSTOMER.DISCOUNT'] + ' %'
end
else
begin
Value := ''
end;
end
else
begin
Value := ''
end;
===================================================

In the Report.DataPipeLine Fields, EVERY field's datatype is dtString. What
may cause this error?

David Caouette
Developer
Omniciel International inc.

P.S : By the way, I developed a Crystal Reports to Report Builder converter.
The resulting .RTM file only needs database settings and few layout
adjustements. Only TeeChart and CrossTabs are the last items to be
implemented.

Comments

This discussion has been closed.