cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AM13337
Engaged Sweeper III
I've created a simple report that shows all printer toner levels from my Toronto site which works very well. But, i want to highlight the ones that haven't been seen in more than 12 hours.

Here is a sample of my report, and i would like to have the tblAssets.Lastseen show colors if it's older then 12 hours.

thanks for the help!

Select Top (1000000) tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.AssetName,
tblAssetCustom.Model,
tblAssetCustom.Location,
tblAssetCustom.Serialnumber,
tblAssets.IPAddress As [IP Address],
tblAssets.AssetID,
Case When tblCustDevPrinter.TonerMaximum = 0 Or
tblCustDevPrinter.TonerRemaining = 0 Then 0
Else Floor(tblCustDevPrinter.TonerRemaining / tblCustDevPrinter.TonerMaximum
* 100) End As [Remaining %],
tblCustDevPrinter.Tonername As [Toner Name]
From tblCustDevPrinter
Inner Join tblAssets On tblCustDevPrinter.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Left Outer Join tsysIPLocations On tsysIPLocations.StartIP <=
tblAssets.IPNumeric And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Where tsysIPLocations.IPLocation Like '%Toronto%'
Order By [Remaining %]
1 REPLY 1
David_G
Lansweeper Employee
Lansweeper Employee
We have added an edited version of the report you have provided on this topic below that will highlight Assets with a last seen date older then 12 hours. More example of how to use colors with Lansweeper reports can be found in this Forum topic.

Instructions for adding this report to your Lansweeper installation can be found here. If you are interested in building or modifying reports, we do recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Making use of our database dictionary, which explains in great detail what each database table and field stores. More information on the dictionary can be found here.
Select Top (1000000) tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
Case When tblAssets.Lastseen < DateAdd(hh, -12, GetDate()) Then '#FF8396'
End As backgroundcolor,
Case When tblAssets.Lastseen < DateAdd(hh, -12, GetDate()) Then '#fbfb86'
End As foregroundcolor,
tblAssets.AssetName,
tblAssetCustom.Model,
tblAssetCustom.Location,
tblAssetCustom.Serialnumber,
tblAssets.IPAddress As [IP Address],
tblAssets.AssetID,
Case When tblCustDevPrinter.TonerMaximum = 0 Or
tblCustDevPrinter.TonerRemaining = 0 Then 0
Else Floor(tblCustDevPrinter.TonerRemaining / tblCustDevPrinter.TonerMaximum
* 100) End As [Remaining %],
tblCustDevPrinter.Tonername As [Toner Name]
From tblCustDevPrinter
Inner Join tblAssets On tblCustDevPrinter.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Left Outer Join tsysIPLocations On tsysIPLocations.StartIP <=
tblAssets.IPNumeric And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Where tsysIPLocations.IPLocation Like '%Toronto%'
Order By [Remaining %]