Function needed: saves slice and tableSize and formats then loads and applies to new data
We have gone crazy trying to suggest a practical way to use the component:
- User opens report (json form a database query) and fiddles with it until it looks ok for rows, columns, measures and tablesizes and formats.
- User saves ONLY slice and tablesize and formats, BUT NOT data
- User comes back later and brings json from database, new data from the same report. Updated data…
- User opens the slice-format etc file and applies it to loaded new data
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.
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:
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:
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.
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.
- User will call raw report
- User will define view of report
- User will save the slice and others associated with report and user’s credentials.
- Next time user needs the report it will com with data plus slice to reformat
- User will be able to save as usual full report and data locally
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.
Thank you for providing more details about your use case.
Let me suggest you the following flow:
- User opens the raw report. This report needs to have
dataSourcesection, otherwise, it is not possible to configure slice, format, etc.
- User fiddles with the report until it looks ok
- User saves view (slice, format, etc.). This can be achieved by getting the current report via
dataSourcesection, and saving this config.
- User opens new data source and wants to apply the previous view. He selects the necessary view, and the new report is composed by merging
getReport().dataSourcewith view configuration. Then this new report can be set via
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
Concerning your question about
filename property, we recommend specifying all the necessary parameters here. For example:
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.
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
In such case, the way how you get JSON data is completely up to you.
The app is already doing the following:
- User selects a raw data report supplier. Just row records in JSON format.
- The JSON formatted rows are set as data to the Flexmonster report being created.
- Report is shown and USER fiddles with report until it looks ok for her.
- User clicks on button that executes a function that:
- Removes datasource section
- Stores the remaining to the remote database
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.
We are glad you have managed to configure your app.
Let us know how the further process goes.