cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
BSONO
Engaged Sweeper II
Error where printers should be listed when clicking specific report:
"Report has an invalid syntax:
Divide by zero error encountered."

Occurs when clicking these reports from the All Available Reports page:
"Printer almost out of toner"
"Printer Toner level"

There are 41 printers showing in the Device list.

This is the Lansweeper 4.1 1/13 version.
Running on Windows XP on a local database using the SQL server free edition.

Printers found by ip scan.

Let me know if there is anything else you need to know.
5 REPLIES 5
BSONO
Engaged Sweeper II
This fix worked! Thanks for the quick response and solution.

By the way, I'm am very much liking 4.1. Keep up the awesome work!
Hemoco
Lansweeper Alumni
This sql script should fix the problem:

ALTER VIEW dbo.web40repprinteralmosttoner
AS
Select Top 1000000 tsysDevicetypes.ItemTypeIcon10 As icon,
tblCustDevices.Displayname As [Device name], tblCustDevices.Model As [Device model], tblCustDevices.DeviceKey,
Floor(tblCustDevPrinter.TonerRemaining / tblCustDevPrinter.TonerMaximum * 100) As [Remaining %], tblCustDevPrinter.Tonername, tblCustDevPrinter.Lastchanged
From tblCustDevices Inner Join
tsysDevicetypes On tsysDevicetypes.ItemType = tblCustDevices.Devicetype
Inner Join
tblCustDevPrinter On tblCustDevPrinter.DeviceKey = tblCustDevices.DeviceKey Where Floor(tblCustDevPrinter.TonerRemaining / tblCustDevPrinter.TonerMaximum * 100) <= 10 And tblCustDevices.State = 1 And tblCustDevPrinter.TonerMaximum > 0 Order By Floor(tblCustDevPrinter.TonerRemaining / tblCustDevPrinter.TonerMaximum * 100)
GO

ALTER VIEW dbo.web40reptonerlevel
AS
Select Top 1000000 tsysDevicetypes.ItemTypeIcon10 As icon, tblCustDevices.Displayname As [Device name], tblCustDevices.Model As [Device model], tblCustDevices.DeviceKey, Floor(tblCustDevPrinter.TonerRemaining / tblCustDevPrinter.TonerMaximum * 100) As [Remaining %], tblCustDevPrinter.Tonername, tblCustDevPrinter.Lastchanged From tblCustDevices Inner Join tsysDevicetypes On tsysDevicetypes.ItemType = tblCustDevices.Devicetype Inner Join tblCustDevPrinter On tblCustDevPrinter.DeviceKey = tblCustDevices.DeviceKey Where tblCustDevices.State = 1 And tblCustDevPrinter.TonerMaximum > 0 Order By Floor(tblCustDevPrinter.TonerRemaining / tblCustDevPrinter.TonerMaximum * 100)
GO
BSONO
Engaged Sweeper II
Certainly, the no. of printers has gone up, because it's currently scanning ip ranges.

I'm too slow.
Hemoco
Lansweeper Alumni
Problem confirmed, this happens when the "tonermaximum" value is "0"
Hemoco
Lansweeper Alumni
Can you provide a screenshot of this please.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now