Reporting Service is a service running independently on seperate server. This service loads the report configuration from a yaml file at the run time and provides the report details by using couple of APIS.
- Provides metadata about the report.
- Provides the data for the report.
- Reload the configuration at runtime
- All the module yml configurations are located in docs/{modulename}/report/report.yml
- reportName: Name of the report
- summary: Summary message for the report(AssetReport)
- version: version of the report(optional)
- moduleName: modulename of which the report belongs to (eg : asset)
- sourceColumns: - (list of source columns fetched from the query.)
- name: receiptNo (column name)
- label: reports.citizen.receiptno (label which will get displayed in the report)
- type: string (typr of the column)
- source: citizen (source module)
- name: receiptNo (column name)
- searchParams:(list of search parameters which is required for the report)
- name: consumerno (name of the search param)
- label: reports.citizen.consumerno (label which will be used for displaying the search param. It has to be created in common.js Front end team will update this information)
- type: string (type of the search param)
- source: (source module)
- isMandatory: false (specifies whether the search param is optional or not)
- searchClause: and consumerNo = $consumerno (Search clause will get appended to the query based on the ismandatory flag. if it is false and the search param is having that parameter then it will get appended
otherwise it will not get appended)
- name: consumerno (name of the search param)
- query: (query string which needs to get execute to generate the report with the place holders for the search params. refer - sample config for clarifications)
- groupby: group by clause if needed(group by fieldname)
- orderby: order by clause if needed(order by fieldname asc)
/report/asset/metadata/_get
Request Sample for Metadata API:
{
"RequestInfo": {
"apiId" : "emp",
"ver" : "1.0",
"ts" : "10-03-2017 00:00:00",
"action" : "create",
"did" : "1",
"key" : "abcdkey",
"msgId" : "20170310130900",
"requesterId" : "rajesh",
"authToken" : "0348d66f-d818-47fc-933b-ba23079986b8"
} ,
"tenantId" : "default",
"reportName" :"ImmovableAssetRegister"
}
#########################
/report/asset/_get
{
"RequestInfo": {
"apiId" : "emp",
"ver" : "1.0",
"ts" : "10-03-2017 00:00:00",
"action" : "create",
"did" : "1",
"key" : "abcdkey",
"msgId" : "20170310130900",
"requesterId" : "rajesh",
"authToken" : "39b6d8aa-e312-441e-8162-7032ae1303e1"
},
"tenantId": "default",
"reportName": "ImmovableAssetRegister",
"searchParams": [
{
"name" : "assetid"
"input": ["1","2"]
}
]<br />
}
########################
: /report/_reload
Request Sample for reload API:
{
"RequestInfo": {
"apiId" : "emp",
"ver" : "1.0",
"ts" : "10-03-2017 00:00:00",
"action" : "create",
"did" : "1",
"key" : "abcdkey",
"msgId" : "20170310130900",
"requesterId" : "rajesh",
"authToken" : "3081f773-159b-455b-b977-acfd6ed2c61b"
} ,
"tenantId" : "default",
}
- Configuring the post object in the yaml itself like below.
- externalService:
- entity: $.MdmsRes.egf-master.FinancialYear
- apiURL: http://localhost:8094/egov-mdms-service/v1/_search
- keyOrder: finYearRange,startingDate,endingDate,tenantId
- tableName: tbl_financialyear
- stateData: true
- postObject:
- tenantId: $tenantid
- moduleDetails:
- moduleName: egf-master
- masterDetails:
- name: FinancialYear filter: "[?(@.id IN [2,3] && @.active == true)]"
- entity: $.MdmsRes.egf-master.FinancialYear
- Keep the post object in a seperate json file externally and call at runtime.