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: 24
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: 24  
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: 24  
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 WLC 5508 question
by  Faktotum   Go to last post Go to first unread
Last post: Today at 1:10:23 PM(UTC)
Lansweeper SNMPv3 global credentials ?
by  JeremySG  
Go to last post Go to first unread
Last post: Today at 9:01:16 AM(UTC)
Lansweeper Help Desk not disabling for regular users?
by  Hagobian   Go to last post Go to first unread
Last post: Yesterday at 11:20:17 PM(UTC)
Lansweeper Wake on Lan wol.exe issue
by  Socal_s197  
Go to last post Go to first unread
Last post: Yesterday at 10:08:02 PM(UTC)
Lansweeper Changing DNS Servers via CMD or PowerShell
by  TheITGuy   Go to last post Go to first unread
Last post: Yesterday at 8:46:06 PM(UTC)
Lansweeper Scanning IP Range Subnet
by  TheITGuy  
Go to last post Go to first unread
Last post: Yesterday at 8:42:04 PM(UTC)
Lansweeper Access LS Knowledge base from outside network
by  TheITGuy   Go to last post Go to first unread
Last post: Yesterday at 8:36:55 PM(UTC)
Lansweeper Problems with deploying PowerShell script
by  TheITGuy  
Go to last post Go to first unread
Last post: Yesterday at 8:29:45 PM(UTC)