Thursday, February 5, 2015

Create Report With Lexical Parameter.


Lexical parameter is used to replace a specific ‘String’ in sql statement at runtime.

  • It can be created with ‘&’ at runtime.
  • String to  replace can be handled in ‘After Parameter Form’trigger.
  • Used in SQL only.
  • Used in all Clauses.
In this example we are going to retrieve the employees who hired in certain period of time i.e.
Step 1: Open Reports builder and connect the database, go to the data model of a new report and write a query as bellow
Create_report1
Press OK, system will show that ‘Query has created the lexical parameter’
Create_report2
Step 2: Now create report using this query. To do this right click on ‘Q_1’ and select ‘Report Wizard’ shown below
Create_report3
Create_report4
Create_report5
Create_report6
Create_report7
Create_report8
Create_report9
Create_report10
Create_report11
Step 3: Provide the dynamic parameter value as bellow
Create_report12
Create_report13
you can also use WHERE hirdate > ’01-Jan-2012′ OR WHERE hirdate = ’01-Jan-2012′ WHERE hirdate BETWEEN ’01-Jan-2012′ AND ’01-Jan-2013′

No comments: