Link to home
Start Free TrialLog in
Avatar of greeno
greeno

asked on

Run-time error "20572"

Hi All,
     I keep getting the following error everytime I try to print a crystal report in a database on a particular machine.

Run-time error '20572'.
Invalid negative value.

    Anyone have any idea what this means? The program runs fine on other computers with the exact same configuration and other database programs with crystal reports run fine on this computer.

    I have even reformatted the computer and still have the same problem..

    I can't seem to find any documentation about this error anywhere.

Thanks.
Avatar of karoo
karoo

greeno,

Crystal Reports version?
Database?
Front end?
ASKER CERTIFIED SOLUTION
Avatar of Sidneym
Sidneym

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
check the diff in the screen resolution set in windows ..chances are ,, the PC is set to lower resolution like (640X480)
Avatar of greeno

ASKER

I have found the solution to the problem.

In the VB program when I am opening the Print Preview Screen I am sizing it to the same size as the main database window.

The problem only occurs when the form is maximised so I am guessing that Form.Height and Form.Width are set to strange values when the form is maximised thus causing the problem in the Crystal OCX.

I'll try and fix it tonight and see how it goes.

SidneyM, I guess the the same thing would happen if you tried to set the coordinates outside the window. I'll test this and let you know the outcome.

I guess this is one for the memory banks.

I have deleted this question since I found the solution myself.

Thanks..
Avatar of greeno

ASKER

This question has a deletion request Pending
which is exaclty what was mentioned in my comment

......The problem is that the preview window is attempting to open outside of the viewable area of the display screen.


 

Avatar of greeno

ASKER

What you said is not correct (well it might be but it was not my problem).

The screen resolutions are the same, the crystal preview window is programmatically set to the same size of the form which is definintely not outside the screen coordinates.

In any case changing the resolutions would not solve the problem which was your solution.

I actually worked out the answer to the problem before I even knew there were comments on experts exchange.

The question should be deleted.
Avatar of greeno

ASKER

I have given you the points even though your answer wasn't strictly correct in my case.

After solving the problem in VB it appears that when a form is maximised the Form.Left and Form.Top properties are set to -60 which was obviously outside the viewable area.

I would like to know where you found the above paragraph on the net cause I couldn't find any information when I was looking around.

Thanks..
I thought it was the screen res of the pc because you mentioned that only a particular machine is having the prob. So bearing this in mind , i did not think it would be the code....( BTW how come it was ok for the rest of the PC ?  )

Anyway  thanks for the points !! the URL is
http://www.avimate.com/support2.htm

...sorry for locking the question i thought it was the only way to avoid this item being deleted.
Avatar of greeno

ASKER

I too thought the code would be the last thing to have a problem.

The other users using the database run it as a window rather than maximising it so it didn't cause the problem.

The other databases on the machine with the problem always opened the crystal reports maximised (forced by me in code). Opening the report the same size as the window is a new idea I had to make it look a little more professional, that'll teach me..

Anyway I just check if the form is maximised now and the problem has gone away.

Thanks for the response..