We have gone crazy trying to suggest a practical way to use the component:
Honestly, maybe it is too late, but we have gone crazy trying to find a way to do that.
Please, if you know of a way to do what we need, explain. Thanks.
This used to be possible by saving the xml structure files and then opening it: it would immediately apply to the loaded data. That used to be so simple and easy!
New version should BUILD on old versions, but NEVER wipe out what used to be good.
Hello Franz,
Thank you for posting your question.
There could be several approaches to the application of slice, tableSizes and formats to new data.
The first approach requires providing data to the component by accessing a URL of a server-side script that returns data from the database in JSON format.
If it is a viable option for your application, then filename
parameter can be used to provide JSON data, as follows:
{
"dataSource": {
"dataSourceType": "json",
"filename": "https://your_script_that_returns_json_data"
},
"slice": {
...
},
"formats": [
...
],
"tableSizes": {
...
}
}
In this case, a user saves the whole report (slice/formats/tableSizes/etc and dataSource with the URL of a server-side script that returns data).
Setting this report later using setReport()
API call will apply the slice/formats/tableSizes/etc from this report to the new data provided by the script "https://your_script_that_returns_json_data".
I have attached a sample report file to this answer (report-with-json-from-url.json)
Could you please let me know if this approach could work for you?
If you prefer to supply JSON data to the component through data
parameter, as follows:
{
"dataSource": {
"data": jsonData
}
}
then, in this case, the scenario can be implemented in a different way. If this option of providing JSON data works better for you, please let me know, and I will provide you with the instructions on this approach.
I'm looking forward to your answer.
Kind regards,
Iryna
I was unable to find the attached report mentioned by you. It is a different approach and also similar reports might requiere different views for different users. I am working on a different solution right now. Also the URL to execute a report must be sent by POST, because of sensitive data that would be visible in the URL.
I hope this approach will work.
Please the filename URL will be POST or GET?
We need to send several parameters and we are doing that right now when the user selects the raw data report she needs.
The data is sent in the form of JSON and the first slice is auto created. Very simple.
Please do send any other idea you may have. The idea is that the user's designed view can be easily applied to new data at all times. The user will be able to create more than one slice version.
Hello, Franz,
Thank you for providing more details about your use case.
Let me suggest you the following flow:
dataSource
section, otherwise, it is not possible to configure slice, format, etc.getReport()
method, removing dataSource
section, and saving this config. getReport().dataSource
with view configuration. Then this new report can be set via setReport()
.So, as you can see, saving the full report, as usual, can be achieved with getReport()
; saving current view should be done the same way, you just need to remove dataSource
subobject.
Concerning your question about filename
property, we recommend specifying all the necessary parameters here. For example:
filename: "http://olap.flexmonster.com/compressor/demo.php?parameter1=value1¶meter2=value2"
filename
is either a URL to CSV or JSON file or a URL to the server-side script which generates data. Request Method for filename
parameter is GET.
Please note that suggested scenario allows creating more than one slice version and saving it the way you need.
Let me know whether you were able to implement everything successfully.
Regards,
Tanya
Franz,
I would also like to mention that if GET Request Method of filename
parameter does not work for your case, you can set JSON data via dataSource.data
property:
{
"dataSource": {
"data": jsonData
}
}
In such case, the way how you get JSON data is completely up to you.
Regards,
Tanya
The app is already doing the following:
Next time the user calls the same raw report, at the database it is recognized that such ID (of user) when calling the IDREPORT, should come already formatted with previously chosen slice and formats.
User will be given a list of previously created slices, with different descriptions, created by herself and perhaps, created for the whole company, maybe without permission to modify it.
So, the server sends the raw data as the datasource section, which is added to the JSON structure previously saved.
I am working on the above process right now. Hopefully, it will work. I will let you know and invite you to test it.
Franz,
We are glad you have managed to configure your app.
Let us know how the further process goes.
Regards,
Tanya