Notification

Icon
Error

Custom Widget to show Imac Assets

Posted: Monday, June 15, 2015 2:25:25 PM(UTC)
LJayP

LJayP

Member Premium Users Original PosterPosts: 15
0
Like
This issue has been solved! Click here to view the solution
Hello,

I was wondering if there is a custom widget which will show a list of active or inactive Macs. I know the widget for active assets work but im trying to dim it down to just Imacs so I can add a separate widget to my homepage.

Thanks

Edit

Quote:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LastAssets.aspx.cs" Inherits="LastAssets" ResponseEncoding="utf-8" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="LS" %>
<% Response.CacheControl = "no-cache";%>
<% Response.AddHeader("Pragma", "no-cache"); %>
<% Response.Expires = -1; %>
<% LS.User.Current().CheckWebsiteAccess(); %>
<div style="margin: 2px;">
<table border="0" cellspacing="1" cellpadding="0">
<% foreach (DataRow myrow in dt.Rows)
{%> <tr>
<td align="left" valign="top" class="stippel"><img src="images/<% if ((int) myrow["assettype"] == -1)
{%><%: myrow["compimage"] %><% }
else
{%><%: myrow["AssetTypeIcon10"] %><% }%>" width="10" height="10" hspace="3" vspace="2" /></td>

<td align="left" valign="top" class="stippel"><a class="popup" rel="<%: myrow["AssetID"] %>" href="<%=ResolveUrl("~/")%>Asset.aspx?AssetID=<%: myrow["AssetID"] %>"><%: myrow["AssetName"] %></a><br />
</td>

<td align="left" valign="top" class="stippel"><%try{%>&nbsp;<span class="sml"><%= ((DateTime)myrow["lasttime"]).ToString(LS.User.Current().DateFormatTime)%></span><%}catch{}%></td>
</tr>

<% } %>
</table>
</div>
<%= AutoRefresh(30) %>


I was seeing if this can be edited to just look for macs instead of all assets?
Daniel.B
#1Daniel.B Member Posts: 1,150  
posted: 6/16/2015 2:22:33 PM(UTC)
The easiest way would be to add a new Data report or Chart report widget to your Dashboard which you use in combination with a custom report. The following report lists Mac assets counted by their asset state. If you save it under a name beginning with "Chart: ...", you will be able to use it for a Chart report widget.
Code:

Select Top 1000000 tblState.Statename,
  Count(tblAssets.AssetID) As Number
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tblState On tblState.State = tblAssetCustom.State
Where tsysAssetTypes.AssetTypename like 'apple mac'
Group By tblState.Statename
Order By tblState.Statename
LJayP
#2LJayP Member Premium Users Original PosterPosts: 15  
posted: 6/16/2015 4:03:27 PM(UTC)
Thank you this seems to work, I will need to tweak it a bit but this is the base query I was after. Thank you, sorry for the all questions recently im still new to it all Angel

Active Discussions

Lansweeper Automatic Follow-Up for Tickets
by  Francis Lee Mondia - Endace   Go to last post Go to first unread
Last post: Yesterday at 11:06:51 PM(UTC)
Lansweeper Can't see devices on Lansweeper
by  vqT4cDoP9iXyMZwoDUWU  
Go to last post Go to first unread
Last post: Yesterday at 8:33:21 PM(UTC)
Lansweeper LAPS managed password
by  SystemAdmin   Go to last post Go to first unread
Last post: Yesterday at 6:08:42 PM(UTC)
Lansweeper Install Adobe Reader Error
by  Brandon  
Go to last post Go to first unread
Last post: Yesterday at 2:46:54 PM(UTC)
Lansweeper Stop deployment
by  Tyler M.   Go to last post Go to first unread
Last post: Yesterday at 1:59:22 PM(UTC)
Lansweeper "Out of memory" in errorlog.txt
by  dua  
Go to last post Go to first unread
Last post: Yesterday at 1:00:42 PM(UTC)
Lansweeper Installation issues
by  Troy   Go to last post Go to first unread
Last post: Yesterday at 9:24:54 AM(UTC)
Lansweeper End of Life Asset Report
by  DJ Bradley  
Go to last post Go to first unread
Last post: 5/11/2021 4:09:33 PM(UTC)