set report parameters with .csv files as datasource

 

Source

  https://forums.opentext.com/forums/discussion/50068/set-report-parameters-with-csv-files-as-datasource#latest

Problem

  our datasource is multiple csv files. we want to set the report parameters to this. How can we do that.

  using query birt provides the option of wild cards and linking of report parameters to dataset parameters. But when .csv files are our datasource there is no option of sql query. In such cases , how can we set the report parameters.

Answer

  SQL query in birt can specify dataset parameters. When dataset parameters are used, they can also be linked to a report parameter, which is simple and easy to operate. Of course, if you want to query data files of CSV type, it is also very convenient, but the dataset of CSV type does not support the specified dataset parameters. If you want to achieve filtering, you can only use the dataset filtering function, and there are some limitations when you use it. Therefore, here we recommend a useful tool - esProc, which is easy to operate and learn, can both filter and transmit parameters, and there are many benefits.

  Let's take Birt reporting tool as an example to introduce the implementation process:

  In this example, employee sales information is stored in sale. csv, and employee information with dates greater than 2015-03-02 needs to be queried based on input parameters.

  sale.csv data are as follows

    userName,date,saleValue,saleCount
    Rachel,2015-3-1,4500,9
    Rachel,2015-3-3,8700,4
    Tom,2015-3-2,3000,8
    Tom,2015-3-3,5000,7
    Tom,2015-3-4,6000,12
    John,2015-3-2,4000,3
    John,2015-3-2,4300,9
    John,2015-3-4,4800,4

  Here we take accessing local CSV files as an example to show how to use parameters for CSV datasets in birt.

  The integration of BIRT with esProc is not introduced here. Please refer toHow to Call an SPL Script in BIRT.

  Step 1: Add an esProc JDBC data source.

  undefined

  Step 2: Add the dataset and write the SQL query CSV file directly.

  Query text

  undefined

  Report parameter

  undefined

  Set dataset parameters and link them to report parameters:

  undefined

  Step 3: Create report

  The report is designed as follows:

  undefined            

  Step 4: WEB preview, input parameters, preview results:

  1input parameterDate 2015-03-02

  undefined

  undefined