Notification

Icon
Error

Insert custom report into database

Posted: Tuesday, November 20, 2018 2:47:10 PM(UTC)
hestia

hestia

Member Original PosterPosts: 1
1
Like
Hello,

I'm trying to insert my custom report directly into the database. But when I try to run the report I got the following error: "Cannot find query"

I've run the following code:
Code:
insert into dbo.tsysreports (dbo.tsystreports.Reportquery, dbo.tsysreports.Reporttitle, dbo.tsysreports.CreatedBy, dbo.tsysreports.Created) 
values ('cust_ot_servers','OT Intake Servers','Lansweeper Installation', GETDATE());

create view dbo.cust_ot_servers as
Select 
  tblAssets.AssetName As Title,
  tblADComputers.Description As Description,
  null As Type,
  REPLACE(REPLACE(REPLACE(tblComputersystem.Roles, 'LM_Workstation , LM_Server ,', ''),'NT , Server_NT',''), ',','') As Role,
  tsysOS.OSname As "Operating System",
  tblAssets.IPAddress As "Ip Addres",
  null As "Environment Status",
  tblAssets.Memory As Memory,
  null As Alias,
  null As Hostgroup,
  null As Connection,
  null As Version,
  null As "Vendor Support ID",
  tblSystemEnclosure.SerialNumber As "Serial Number",
  null As "Nr. Sockets",
  tblAssets.NrProcessors  As "Nr. Cores",
  null As "Management URL",
  null As "Maintenance Window",
  null As "Linked Datastore",
  tblComputersystem.Model As "Hardware Type",
  null As "Connection Port",
  null As "Backup Engine",
  null As "Attached Storage",
  null As "Additional Role",
  null As "Additional IP Address"
From tblComputersystem
  Inner join tblSystemEnclosure on tblSystemEnclosure.AssetID = tblComputerSystem.AssetID
  Inner Join tblAssets On tblComputersystem.AssetID = tblAssets.AssetID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblADComputers on tblADComputers.AssetId = tblAssets.AssetID
  Left Join tsysIPLocations On tsysIPLocations.StartIP <= tblAssets.IPNumeric
    And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Where tblComputersystem.Domainrole > 1 And tblAssetCustom.State = 1;


What am I doing wrong?
hestia attached the following image(s):
Capture.PNG
mc_connected
#1mc_connected Member Posts: 10  
posted: 6/20/2019 3:46:06 PM(UTC)
Did you ever get this working? While I am grateful that we get lots of reports written for us, I find it cumbersome to add them all the time via the UI.

Active Discussions

Lansweeper how to add windows and office licenses manually.
by  cesar.ti   Go to last post Go to first unread
Last post: 8/23/2019 7:32:10 PM(UTC)
Lansweeper User roles and permissions
by  RKCar  
Go to last post Go to first unread
Last post: 8/23/2019 6:23:38 PM(UTC)
Lansweeper Deployment condition
by  RKCar   Go to last post Go to first unread
Last post: 8/23/2019 4:07:30 PM(UTC)
Lansweeper HP Printer not showing correctly
by  JacobH  
Go to last post Go to first unread
Last post: 8/23/2019 1:32:54 PM(UTC)
Lansweeper Moving Assets in Location not Saving
by  brodiemac   Go to last post Go to first unread
Last post: 8/23/2019 12:23:04 PM(UTC)
Lansweeper Scanning includes IOS devices even though I exclude them??
by  steveb  
Go to last post Go to first unread
Last post: 8/22/2019 11:05:33 PM(UTC)
Lansweeper lsagent not scanning/sending when using relay
by  Esben.D   Go to last post Go to first unread
Last post: 8/19/2019 12:31:02 PM(UTC)
Lansweeper Check if Netbios is disabled over TCP/IP
by  TaherMD  
Go to last post Go to first unread
Last post: 8/19/2019 6:00:51 AM(UTC)