Hello,
I have a sql result set that column names may start with "t+". Example; "t+Duration". How can i say to the Flexmonster that column's type is time in the .net core custom data source API instead of adding mapping json into the report?
Thanks
Berkay
mapping: {
"Duration": {
type: "time"
}
}
Hello Berkay,
Thank you for reaching out to us.
Currently, Flexmonster only allows setting the "time"
data type in the mapping object. That is why we recommend setting the mapping on the client side in the report object. You are welcome to check our documentation for more details: https://www.flexmonster.com/doc/mapping/.
Please let us know if it works for you.
Kind regards,
Nadia
Hello Nadia,
Thank you for responding.
The only way to know that the column type is time is from the sql result. So, mapping information can not be added by client. Is there any way to do it in API side?
Kind regards,
Berkay
Hello Berkay,
Thank you for the response.
Flexmonster supports setting the mapping as a URL to a file. You can create a JSON file on the server with the type definitions, for example:
{
"Duration": {
"type": "time"
}
// ...
}
Then, in the report, define the mapping as a URL to your file:
report: {
dataSource: {
// other configs
mapping: "<URL_to_your_mapping_file>"
}
}
Also, the input time format should be specified as a number of seconds. For instance, here is how a time field can be specified in a JSON data source:
[
{
"Event": "Concert",
"Duration": 451515
}
]
Please let us know if it works for you. Looking forward to hearing from you.
Kind regards,
Nadia
Hello Berkay,
Hope you are doing well.
We were wondering if you had a chance to test a suggested approach. Could you please confirm if it works for you?
Looking forward to hearing your feedback.
Kind regards,
Nadia
Hello Nadia,
I could not have a chance to try. When I do it, I will inform here.
Thanks for help.
Kind regards,
Berkay