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

System.ArithmeticException

Status
Not open for further replies.

LikePork

Programmer
Aug 13, 2004
42
CA
Hi,

We're nearing time to deploy our program but we've run into a problem using Crystal Reports .NET and windows 98. Everything works fine on other Windows with the .Net framework but when we load a form with 98 and .Net we get

System.ArithmeticException

Overflow or underflow in the arithmetic operation

It only occurs on the first time the report is loaded, so they are total hack fixes like calling the report once, catching the exception then calling it again, but this amateur stuff won't fly for my boss. Anyone ever find a resonable solution to this problem. The font used in the report is Times New Roman, which should be fine on win98.

Apaarently this problem is caused by the fact that
"If a managed application calls into unmanaged code that must modify the floating-point control register, the unmanaged code must return the floating-point register to its default state before it returns program control to the managed application."

but are the Crystal dlls unmanaged, I'm not sure. I found this stuff
here

and here

Any inforamtion on this problem would be appreciated
 
I've been working with it all day and I've found it's actually the font for our custom windows form that raises the exception. Strange though it only gets this problem when the CrystalDecisions.Windows.Forms.CrystalReportViewer component is on the form. If I take the explicit font declaration out and let VS do its thing, it still hits an error, don't know where yet, probably generated some new code or something. I don't get it....

I'll keep posting
 
Ok I tracked down the problem. I used ADO datasets to fill the reports, and the line of code that caused the problem, (not where the error happened but the reason for it) was :

myReport.setDataSource(CrystalData)

where myReport is the .rpt report object and CrystalData is the Dataset used to fill the report.

So I made a workaround that's not great but I guess the song was right, "you can't always get what you want", "but if you try sometimes" you can make an ugly workaround to handle all Windows platforms suppoting .Net and Crystal Reports.

Not sure about the unmasked exception raised by Crystal, or the reason it caused .Net to fail to draw, not draw the report but the form itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top