How to create a custom report with parameters in LANDesk Management Suite

Version 12

    Verified Product Versions

    LANDESK Management Suite 9.5LANDESK Management Suite 9.6LANDESK Management Suite 9.0 and OlderLANDESK Management Suite 2016.x

    INTRODUCTION

     

    In this short walk-through we are going to demonstrate how to build a custom report using parameters.

    This article is not exhaustive of the the topic. If you have further question please comment to this article or post then to this section of the community

    (LANDesk User Community > LANDesk Management Suite > Reporting)

     

    Note: LANDesk Technical Support will not provide training or create or alter custom reports or SQL statements for customers. Support is limited to product issues only. This document is an example of product use and is provided as is with no warranty.

    Ref: http://community.landesk.com/support/docs/DOC-21733

    DESCRIPTION
    In LDMS it is possible to create custom report that before to run asks to the user to pass one or more parameters. In this example we will use only one parameter.
    So let’s start to create a blank report and then follow these steps:
    1.Add to the report one DataSet and type in the Query field this SQL statement:
    Select * from computer where dbo.Computer.Type like ?
    
    (the final question mark in the statement is actually part of the statement)
    2.Create another dataset and type in the Query field this SQL statement:
    Select distinct [type] from computer
    
    3.Now right click on the Parameters section (left bottom pane, same pane of Datasets) and choose the option Add Report Parameter
    4.In the Name field enter a symbolic name for it as OSType (no spaces or funny chars please)
    5.In the Text for prompting section write what the reporting engine will ask as question to the user (example: Operative System Type)
    6.In this example we can leave the Data type to String and all the other options as the default values.
    rep.png
    7.Now in the Parameters GUI click on the second small icon above the General section and choose the radio option From query. [underlined in red in the previous image]
    8.Set the Dataset to the one created in the point 2 and the Value field and the Label field to TYPE then press the Accept link.
    In this example the Label field and the Value field are the same but they can be different.
    The Value is what the engine passes to the SQL query and the Label is what the user sees on the screen as parameter.
    This feature is very useful when we are asking for some parameters that in the database are expressed as numbers/strings without immediate meaning for the user and we want to display to the use meaningful labels instead of this data.
    Example:DiskType can be 1, 2, 3, 9 and the labels (meaning of the data is IDE, SCSI, External, CDROM).
    In this case we need a dataset that returns both the value and the label fields and then the associate the fields to the Value field and the Label field in the GUI.
    rep2.png
    9. Now right click on the first dataset created and edit it. Choose the Parameters option in the GUI.
    .
    10.Press the green plus sign there and set the Name as the name of the parameter ( OSType ) and the value to this:
    =[@OSType] 
    If you are not confident with this syntax click on the ..<Expression> in the drop down of Value and choose the Parameter from the Parameters section and then click on Insert
    rep3.png
    11.Now if you followed all these instructions you are ready to use the parameter. Simply add a container to the design area (as the table) and drag some fields there and run the report.
    12.Compliments! You have just created your first report with parameters.
    Q: The report with parameter is very cool but i cannot schedule it! Why?
    A: The LANDesk Scheduler cannot guess what you want to pass to the  reporting engine as parameter but there is a workaround.
    When you define a parameter you can define a DEFAULT value for it.
    Q: So how can I define a DEFAULT value for a parameter?

    A: Right click on the paramer and choose the Edit option then click on the Default section of the Parameter GUI. In that section you are able to define a default value for the parameter.

    param.png

     

    The parameter can be a static value or his value can become from a query (you will need a Dataset then)

     

    Q: Where I can find more information on how to use the Report Designer?

    A: In the LANDesk online help and documentation you can find most of the information you need to create a simple custom report. If you need more detailed information about advanced features of the product you can find then here:

    http://www.datadynamics.com/Help/ddReports/webframe.html