Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Latest commit

 

History

History

report

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Reporting Framework

Reporting Service

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.

Features supported

  • Provides metadata about the report.
  • Provides the data for the report.
  • Reload the configuration at runtime

YML configuration

  • All the module yml configurations are located in docs/{modulename}/report/report.yml

Sample yml configuration :

Report Configuration Details:

  • 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)
  • 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)
  • 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)

API Details:

/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",

}


Call the MDMS or any other API with the post method

  1. 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)]"
  1. Keep the post object in a seperate json file externally and call at runtime.