Notification

Icon
Error

Wanting to add color to my report - Wanting to add color to my report to show which are up to date and which programs aren't

Posted: Thursday, February 13, 2020 11:10:07 PM(UTC)
DontByteMe

DontByteMe

Member Original PosterPosts: 11
0
Like
This issue has been solved! Click here to view the solution
Code:
Select Top 1000000 tblAssets.AssetID,
  tblADusers.Lastname,
  tblADusers.Firstname,
  tblAssets.AssetUnique,
  tblAssets.Domain,
  tblSoftwareUni.softwareName As Software,
  tblSoftware.softwareVersion As Version,
  Case tblSoftware.softwareVersion
    When '20.2.11.3' Then '2-Current-20.2.1'
    When '20.0.0.377' Then '0-Original'
    When '20.0.1.2' Then '0A-Original'
    When '20.1.0.81' Then '1-20.1'
    When '20.2.0.48' Then '2-20.2'
    Else 'Unknown'
  End As [Service Pack],
  tblSoftwareUni.SoftwarePublisher As Autodesk,
  tsysOS.Image As icon,
  tsysOS.OSname,
  tblSoftware.softID As softid,
  tblAssets.IPAddress,
  tblAssets.IPNumeric
From tblSoftware
  Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
  Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblSoftwareUni.softwareName Like 'Autodesk Revit 2020' And
  tblAssetCustom.State = 1 And tblSoftwareUni.SoftID = 2521
Order By [Service Pack],
  tblAssets.AssetName,
  Version


The above is the code. I have been playing around and have not come up with what I have been wanting. I have tried the following

Adding

Code:
Case
When '2-Current-20.2.1' then '#d4f4be'
Else '#ffadad'
End As backgroundcolor


I have tried just adding the colors to the case above with still nothing changing color. I was trying to mimic the process from a google vulnerability report but again no avail. Please help me out. My other reports are like the first portion.
KrisNelson
#1KrisNelson Member Posts: 43  
posted: 2/14/2020 3:07:45 PM(UTC)
There is 2 probable issues here; and they are probably both in play.

First, your Case code for the backgroundcolor isn't specifying a table.field to check. (If everything is showing up pink\light red, I could be wrong here)

Second, the value you are looking for won't exist in any table since you are merely replacing it for the display of the report. Meaning you need to check for '20.2.11.3' in order to see what you think is '2-Current-20.2.1'.

-Kris
DontByteMe
#2DontByteMe Member Original PosterPosts: 11  
posted: 2/14/2020 3:10:55 PM(UTC)
Originally Posted by: KrisNelson Go to Quoted Post
There is 2 probable issues here; and they are probably both in play.

First, your Case code for the backgroundcolor isn't specifying a table.field to check. (If everything is showing up pink\light red, I could be wrong here)

Second, the value you are looking for won't exist in any table since you are merely replacing it for the display of the report. Meaning you need to check for '20.2.11.3' in order to see what you think is '2-Current-20.2.1'.

-Kris


Is there a way to add two statements? Such as When '20.2.11.3' Then '2-Current-20.2.1' AND '#d4f4be' ???
I was looking around if there was a way to add two things to one statement but was unable. I also noticed my code has a table called Software Version and that table creates another column Service Pack is there a way to then make another table or case stating When Service Pack is 20.2.11.3 then '#d4f4be'?
KrisNelson
#3KrisNelson Member Posts: 43  
posted: 2/14/2020 3:12:54 PM(UTC)
Just add it in twice; Here is code that 'should' work.

Code:
Select Top 1000000 tblAssets.AssetID,
  tblADusers.Lastname,
  tblADusers.Firstname,
  tblAssets.AssetUnique,
  tblAssets.Domain,
  tblSoftwareUni.softwareName As Software,
  tblSoftware.softwareVersion As Version,
  Case tblSoftware.softwareVersion
    When '20.2.11.3' Then '2-Current-20.2.1'
    When '20.0.0.377' Then '0-Original'
    When '20.0.1.2' Then '0A-Original'
    When '20.1.0.81' Then '1-20.1'
    When '20.2.0.48' Then '2-20.2'
    Else 'Unknown'
  End As [Service Pack],
  Case tblSoftware.softwareVersion
    When '20.2.11.3' then '#d4f4be'
    Else '#ffadad'
  End As backgroundcolor,
  tblSoftwareUni.SoftwarePublisher As Autodesk,
  tsysOS.Image As icon,
  tsysOS.OSname,
  tblSoftware.softID As softid,
  tblAssets.IPAddress,
  tblAssets.IPNumeric
From tblSoftware
  Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
  Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblSoftwareUni.softwareName Like 'Autodesk Revit 2020' And
  tblAssetCustom.State = 1 And tblSoftwareUni.SoftID = 2521
Order By [Service Pack],
  tblAssets.AssetName,
  Version
DontByteMe
#4DontByteMe Member Original PosterPosts: 11  
posted: 2/14/2020 3:19:32 PM(UTC)
Originally Posted by: KrisNelson Go to Quoted Post
Just add it in twice; Here is code that 'should' work.

Code:
Select Top 1000000 tblAssets.AssetID,
  tblADusers.Lastname,
  tblADusers.Firstname,
  tblAssets.AssetUnique,
  tblAssets.Domain,
  tblSoftwareUni.softwareName As Software,
  tblSoftware.softwareVersion As Version,
  Case tblSoftware.softwareVersion
    When '20.2.11.3' Then '2-Current-20.2.1'
    When '20.0.0.377' Then '0-Original'
    When '20.0.1.2' Then '0A-Original'
    When '20.1.0.81' Then '1-20.1'
    When '20.2.0.48' Then '2-20.2'
    Else 'Unknown'
  End As [Service Pack],
  Case tblSoftware.softwareVersion
    When '20.2.11.3' then '#d4f4be'
    Else '#ffadad'
  End As backgroundcolor,
  tblSoftwareUni.SoftwarePublisher As Autodesk,
  tsysOS.Image As icon,
  tsysOS.OSname,
  tblSoftware.softID As softid,
  tblAssets.IPAddress,
  tblAssets.IPNumeric
From tblSoftware
  Inner Join tblAssets On tblSoftware.AssetID = tblAssets.AssetID
  Inner Join tblSoftwareUni On tblSoftware.softID = tblSoftwareUni.SoftID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblSoftwareUni.softwareName Like 'Autodesk Revit 2020' And
  tblAssetCustom.State = 1 And tblSoftwareUni.SoftID = 2521
Order By [Service Pack],
  tblAssets.AssetName,
  Version


Applause Dancing i cannot believe that actually worked. The one thing i haven't tried because I didn't realize you could make another of the same case. Awesome I am satisfied with that result.

Active Discussions

Lansweeper Changes in the licensing model
by  BullGates   Go to last post Go to first unread
Last post: Today at 7:30:32 PM(UTC)
Lansweeper About Memory Changes
by  fjca  
Go to last post Go to first unread
Last post: Today at 5:51:17 PM(UTC)
Lansweeper Wildcard in file scanning to get all files in a directory?
by  RKCar   Go to last post Go to first unread
Last post: Today at 4:03:43 PM(UTC)
Lansweeper Wishlist is dead, no responses from LS staff.
by  RobertB  
Go to last post Go to first unread
Last post: Today at 3:08:12 PM(UTC)
Lansweeper Deploy installer packages not working any more
by  richv   Go to last post Go to first unread
Last post: Today at 3:06:19 PM(UTC)
Lansweeper File Scanning
by  RKCar  
Go to last post Go to first unread
Last post: Today at 2:22:54 PM(UTC)
Lansweeper HP Warranty scan - broken for some products
by  zaty   Go to last post Go to first unread
Last post: Today at 1:52:38 PM(UTC)
Lansweeper How to stop deployments ?
by  Leandro Martins  
Go to last post Go to first unread
Last post: Today at 1:47:22 PM(UTC)