cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JTempleton
Engaged Sweeper III
Hello everyone!

I am wondering if someone has a custom widget that shows the most recent added assets? This would be very close to the widget of last seen assets, but I want it to show based on the first seen instead of last seen.

Thanks!
5 REPLIES 5
JTempleton
Engaged Sweeper III
Morning!

From your first email, I misunderstood what you meant. I took it as add the report to the Alert Report dashboard!

The Data Report widget would have been a lot easier!

Thanks!
Hemoco
Lansweeper Alumni
You could've just created a report though and added that report to the built-in Data Report widget, as explained previously. The Data Report widget can display any report and can be added to the dashboard as well.
JTempleton
Engaged Sweeper III
I spent the day working on this, but I have my widget working. If anyone wants to use it, here is the code:

<%@ Page Language="C#" AutoEventWireup="true" Inherits="LS.BaseControl" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="LS" %>
<% Response.CacheControl = "no-cache";%>
<% Response.AddHeader("Pragma", "no-cache"); %>
<% Response.Expires = -1; %>
<% LS.User.Current().CheckWebsiteAccess(); %>
<%var dsAssets = DB.ExecuteDataset("SELECT Top 10 tblAssets.AssetID, tblAssets.AssetName, tblAssets.Firstseen FROM tblAssets ORDER BY tblAssets.Firstseen Desc");
{%>
<font size="1">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<% foreach (DataRow myrow in dsAssets.Rows)
{%>
<tr>
<td align="left" ><a href="<%=ResolveUrl("~/")%>Asset.aspx?AssetID=<%:myrow["AssetID"]%>"><%: myrow["AssetName"] %></a></td>
<td align="right" valign="top">
<%:myrow["Firstseen"]%>
</td>
</tr>
<% }%>
</table>
</font>
<%=AutoRefresh(10) %>
<%if (LS.User.Current().IsInRole(WebRole.EditConfiguration)){%><% } %>
</div>
<%}%>
<script type="text/javascript">
$('#WTitle<%=TabControlID %>', window.top.document).text("Newest Assets");
</script>
JTempleton
Engaged Sweeper III
Thanks, I will try that. I was hoping to have it just show on the dashboard to see it at a glance.
Hemoco
Lansweeper Alumni
It would be easier to create a report and add this report to the built-in Data Report widget. Open the report builder under Reports/Create New Report, which will generate a default query, tick the Firstseen field in the tblAssets table and set the Sort Type of the tblAssets.Firstseen expression to DESC (descending). You can then give your report a title and save it.