1.2 Migrating ZRS Custom Reports with Prompt Filters

  1. Perform Step 1 to Step 5 in Section 1.1, Migrating ZRS Custom Reports with Simple Filters and without Filters.

  2. Get the query for Input Control (filters).

    For example, if you have a prompt filter for Platform, create a report and select Platform in the Result Objects panel, instead of the Query Filters panel.

  3. Click View SQL.

  4. In the SQL Viewer panel, copy the query and save it on your device.

  5. Perform Step 6 to Step 23 in Section 1.1, Migrating ZRS Custom Reports with Simple Filters and without Filters.

  6. Delete the content from the SQL keyword WHERE through the end.

    For example, the original query is as follows:

    SELECT
     zDevice1.Platform
    
    FROM
     zDevice zDevice1 INNER JOIN zZENObject zZENObject1 ON (zDevice1.ZUID=zZENObject1.ZUID AND zZENObject1.PrimaryType='Device')
     
    WHERE
     zZENObject1.Name IN @prompt('Enter value(s) for Device Name:','A','Managed Device Status\Device Name',Multi,Free,Persistent,,User:0)
     AND (zZENObject1.Path like '/~dev%')
    

    And the modified query is as follows:

    SELECT
     zDevice1.Platform
    
    FROM
     zDevice zDevice1 INNER JOIN zZENObject zZENObject1 ON (zDevice1.ZUID=zZENObject1.ZUID AND zZENObject1.PrimaryType='Device')
    

    All fields related to the query are displayed. If an error is displayed, it indicates that the query has issues, and the query must be modified.

  7. Click OK.

  8. In the Report Inspector panel, expand Fields.

  9. Select all the fields and drag them into the Designer > Detail column.

    All of the fields are added to the report, with their respective names on Column Header.

    If you want to format the report, for example, to change the Column Header, select Column Header > Properties, then change the Height, Width, Border, Font Size, Font Style, and so forth.

  10. After creating a report, perform the following steps to upload it into ZENworks Reporting 5:

    1. In the Repository Navigator panel, expand Server tree.

    2. Select the folder location, then right-click > Add > JasperServer Report.

    3. In the ReportUnit Wizard, specify the details, then click Next.

    4. Select Locally Defined and browse to a report.

    5. Click Next.

    6. In the From the repository list, select /datasources/ZENworks_Datasource.

    7. Click Finish.

  11. In the Report Navigator panel, select Input controls, right-click, then click Create a local input control.

  12. In the Input Control panel, specify the details.

    For example, to create input control for Platform, then in ID specify as Platform, and specify Name, and Description.

  13. Click the Input Control Details tab.

  14. In the Type list, select Multi-select Query.

  15. Select Locally Defined, then click Edit Local Resource.

  16. Specify the details.

  17. Click the Query tab in the Query Language list, select SQL, then specify the query in the Query.

    You must specify the query that you saved on your device in Step 4.

  18. Click the Data Source tab, select From the repository, then select /datasources/ZENworks_Datasource from the list.

  19. Click Save.

  20. In the Input Control, click the Input Control Details tab.

  21. Click the Value and Visible Columns tab.

  22. Specify the details.

    Specify the Name used in the modified query in Step 17.

  23. Click Save.

  24. In the Report Inspector panel, right-click Parameters > Add Parameter.

  25. In the Parameter Properties panel, change Name to the same ID in Step 12, then select java.util.Collection in the Parameter Class list.

  26. In the Designer panel, click .

  27. In the Report Query, append WHERE $X{IN,zZENobject1.name, Platform}

    zZENobject1.name is from Step 17 and Platform is from Step 12.

  28. Click Read Fields and then click OK. If an error is displayed, it indicates that the query has issues, and it must be modified.

  29. (Conditional) If your report has more than one Input Control, perform Step 2 to Step 4 and Step 11 to Step 28.

  30. Go to Repository Navigator, expand your report, right-click the Main jrxml file, then click Replace with current document.

  31. Click Yes to save the report and upload it to the server.

  32. Click OK.

  33. Run the report in ZENworks Reporting 5.