cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Jimurray
Engaged Sweeper II
Is there an easy way to grab all assets that are members of a group, auto open, go to view printable report and then print to a pdf file (destination selectable) and the pdf is auto named to match the asset name? I constantly need to run reports on assets in a group and do the above manually.
1 ACCEPTED SOLUTION
Susan_A
Lansweeper Alumni
It would really be better to create a custom report under Reports\Create New Report that lists the assets and information you are after and then export this report to Excel, CSV or XML, where it can be manipulated further. You won't be able to include all of the "printable report" data in a single report, as it is stored in several unrelated database tables, but SQL reports are the way to go if you need to query multiple assets and specific data.

The "printable report" was never meant to be generated for multiple assets at once (and this is not something that will be implemented).

View solution in original post

5 REPLIES 5
Susan_A
Lansweeper Alumni
The Report tab is a special page that doesn't just pull from a single SQL query and hence cannot be recreated with a single report. It includes data from several unrelated tables with multiple entries per asset. If you tried to include all of these tables in a single SQL report, you would see duplication.

If you include both disks and NICs in a report for instance and have a machine with more than one disk and more than one NIC, you would get an output like the one below. SQL will repeat each disk for each NIC (or each NIC for each disk, however you want to look at it). Each additional, unrelated database table will trigger more duplicates.

To "recreate" the Report tab, you need several reports.

COMP1 DISK1 NIC1
COMP1 DISK1 NIC2
COMP1 DISK2 NIC1
COMP1 DISK2 NIC2
Jimurray
Engaged Sweeper II
Since all of the data that I need in the report is being displayed (per asset requested manually), isn't there already a scrip / report you are running to display all of the data based upon the steps "find asset| report" that generates the http://servername:81/reportdet.aspx?AssetID=12345&print=1 that actually is the viewable report? I guess what I'm asking is when I choose to find an asset, then press report, what actual scrip or report is being called up, and can I use that same "internal" script for my own reports, or do I have to guess how you generated it and try to create one from scratch?
Susan_A
Lansweeper Alumni
It would really be better to create a custom report under Reports\Create New Report that lists the assets and information you are after and then export this report to Excel, CSV or XML, where it can be manipulated further. You won't be able to include all of the "printable report" data in a single report, as it is stored in several unrelated database tables, but SQL reports are the way to go if you need to query multiple assets and specific data.

The "printable report" was never meant to be generated for multiple assets at once (and this is not something that will be implemented).
Daniel_B
Lansweeper Alumni
One addition, you could even directly list the URLs in your report. In the following example, you only need to exchange the name of your Lansweeper server and the group name:

Select Top 1000000 tblAssets.AssetID As [Asset ID],
tblAssets.AssetName,
tblAssets.Lastseen,
tblAssets.Lasttried,
'http://[YourLansweeperServer]/reportdet.aspx?AssetID=' +
Cast(tblAssets.AssetID As nvarchar) + '&print=1' As hyperlink_name_hyp,
'http://[YourLansweeperServer]/reportdet.aspx?AssetID=' +
Cast(tblAssets.AssetID As nvarchar) + '&print=1' As hyperlink_hyp
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Where tblAssetCustom.State = 1 And tblAssetGroups.AssetGroup Like 'Your Asset Group'
Daniel_B
Lansweeper Alumni
There is currently no built-in mass export function. If you have a software or a script which automatically can create PDFs from URLs inside your intranet, you only need to provide the URLs to it in the following format:

https://[YourLansweeperServer]/reportdet.aspx?AssetID=[AssetID]&print=1

In order to list AssetIDs of assets belonging to a specific group, use the following kind of report. Be attentive to give an alias to tblAssets.AssetID as otherwise it wouldn't be displayed in your report.

Select Top 1000000 tblAssets.AssetID As [Asset ID],
tblAssets.AssetName,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Where tblAssetCustom.State = 1 And tblAssetGroups.AssetGroup Like 'Your Asset group'