[ 
https://issues.apache.org/jira/browse/FINERACT-2535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18065996#comment-18065996
 ] 

Arnav Patil commented on FINERACT-2535:
---------------------------------------

The issue occurs because the {{runreports}} endpoint does not support the 
{{BOOLEAN}} data type returned by the query. The {{m_client}} table contains 
boolean fields (e.g., {{{}active{}}}), which causes the report execution to 
fail.

*My Approach* Cast the boolean column to a supported type in the SQL query, for 
example:

 

{{SELECT id, display_name, CAST(active AS CHAR) AS active FROM m_client;}}

> Data type 'BOOLEAN' is not supported in runreports endpoint
> -----------------------------------------------------------
>
>                 Key: FINERACT-2535
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2535
>             Project: Apache Fineract
>          Issue Type: Task
>            Reporter: Victor Romero
>            Priority: Major
>
> Data type 'BOOLEAN' is not supported in runreports endpoints
>  
> Database MariaDB  version 12
> Step to reproduce
> 1. Create a Custom SQL Report
> SELECT * from m_client
> POST 
> https://\{URL_BASE}/fineract-provider/api/v1/reports
> {"reportName":"TEST_REPORT","reportCategory":"","description":"","reportType":"Table","useReport":true,"reportSql":"select
>  * from m_client","reportParameters":[]}
>  
> Run it
> GET on https://\{BASE_URL}/fineract-provider/api/v1/runreports/LIST_CLIENTS
> Response
> {
>     "developerMessage": "The server is currently unable to handle the request 
> , please try after some time.",
>     "httpStatusCode": "503",
>     "defaultUserMessage": "The server is currently unable to handle the 
> request , please try after some time.",
>     "userMessageGlobalisationCode": "error.msg.platform.service.unavailable",
>     "errors": [
>         {
>             "defaultUserMessage": "Data type 'BOOLEAN' is not supported ",
>             "parameterName": "id",
>             "developerMessage": "Data type 'BOOLEAN' is not supported ",
>             "userMessageGlobalisationCode": 
> "error.msg.database.type.not.supported",
>             "args": []
>         }
>     ]
> }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to