I read sometimes in newsgroups about problems with Rave and printer drivers, especially HP, e.g. 2600.
The interesting thing is, that the customer can print without any problems with MS-office or other application, but with Nevrona Rave Reports there is a Division by zero exception with some drivers. An update of the driver sometimes solves the problem but not 100%.
With the following solution is a workaround available that create the reports without exceptions.
Try this and if you found another problem (or solution, of course ) in this area, write me an email.
Some programming libraries (and perhaps MS-Office?!) contain such procedure
call: Set8087CW($133f);
this disables FPU exceptions....
Normally there is some bad code (in the driver) that is changing the FPU control word to cause it to ignore some exceptions and not properly resetting it.
The default value of Default8087CW is $1332, with the following code you can check it in your pascal-code.
If (Get8087CW and $1F3F) <> $1332)
then ShowMessage(Format('CW=$%4.4x',[Get8087CW]));
To make your rave-reporting with "every" driver stable, the following code should work;
var
CW: Word;
begin
CW := Get8087CW;
try
Set8087CW($133f);
RvProject1.ExecuteReport('Report1');
Set8087CW(CW);
except
..
end;
end;
or the asm-way
asm
FLDCW cw
end;
with C++ the workaround should be the secureFPU (I’m not the C++-expert, I hope this is correct !?)
#include "float.h";
void secureFpu() { _control87(PC_64|MCW_EM,MCW_PC|MCW_EM);}
Another trick especially for HP-printer driver is setting in the application the SkipAbortProc to true:
RPDev.SkipAbortProc := true;
(you must insert the RpDevice-unit)
Now your customer can print with Rave and don't get an exception....