We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

I am using mysql as data source. I want to automatically display all columns in the grid without any customization or configuration. is it possible?

Answered
lior asked on November 19, 2020

7 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 19, 2020

Hello,
 
Thank you for reaching out to us.
 
We want to explain that all columns will be displayed automatically without any configuration in case the flat form is used, and the Report Object does not contain the Slice property.
 
For pivot forms (compact, classic), only the first non-numeric field will be placed to rows and the first numeric one to measures. The remaining fields will not be selected. To predefine selected fields, use the slice object mentioned earlier. Slice defines what data subset from the data source is going to be shown in the report.
 
We hope it helps.
Please contact us in case further questions arise.
 
Kind regards,
Illia

Public
lior November 19, 2020

but then I get a pop up I don't want.
i just need to see al fields on grid

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 20, 2020

Hello,
 
Thank you for your feedback.
 
Our team has prepared a sample demonstrating how to display all fields from the data set in a flat form.
You are welcome to check it out by the link: https://jsfiddle.net/flexmonster/suf06ghd/.
 
We want to draw your attention to the fact that the slice property of the report object should not be specified.
Also, we suggest ensuring the showDefaultSlice property of the options object is not set to false (set it to true or leave it undefined as demonstrated in the example).
 
Please let us know if it works for you.
 
Kind regards,
Illia

Public
lior November 20, 2020

still not OK. same probem. I get pop up with fields selector. I just need the grid to display all fields returned from the query.
this is my code:

<FlexmonsterReact.Pivot
ref={pivot}
beforetoolbarcreated={customizeToolbar}
licenseKey="XXXXXXXXXXXXXXXXXXXX"
report={
{
dataSource: {
type: "api",
url: "http://localhost:9500",
index: "a"
},
options: {
showDefaultSlice: true,
grid: {
type: "flat",
},
}
}
}
toolbar={true}
width="100%"
/>
Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 20, 2020

Hello,
 
Thank you for providing us with a code snippet. It did manage to bring some light on the nature of the problem.
 
When using the custom data source API, Flexmonster proposes to select fields instead of loading the default slice. It is made to avoid unnecessary requests to the server-side.
In order to preselect all fields when using custom data source API, we recommend defining the corresponding slice object that would include all fields from the data set.
 
In case configuring a slice is not an option for you, the following workaround can be used.
After Flexmonster successfully loads the report, get all available hierarchies using the getAllHierarchies API call and select them in the slice using the runQuery method.
This approach allows selecting all fields without knowing their quantity and names in advance.
You are welcome to see the JSFiddle we prepared for the demonstration.
 
Please let us know if it works for you.
Feel free to reach out in case any further questions arise.
 
Best regards,
Illia

Public
lior November 21, 2020

Still not OK. I attach a screen shot from your example. u can see that this fields-selector-pop-up is right there at the beginning. It disappear after fetching the data but I don't want to see it at all. If the user wants to open this pop up voluntarily with the open-fields-button that's fine. but at first load,  I just need the grid to display all fields returned from the query.

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 23, 2020

Hello,
 
Thank you for your feedback.
 
If the Field List must not be shown after Flexmonster initialization, use one of the following approaches:
 
Subscribe to the fieldslistopen event and close the Field List after it is opened for the first time:

flexmonster.on("fieldslistopen", () => {
  flexmonster.off("fieldslistopen");
  flexmonster.closeFieldsList();
})

We have complemented the JSFiddle to demonstrate this approach.
 
Another approach is to predefine the slice object so that it includes all fields from the data set. It implies that unique names of all fields are known before initializing Flexmonster. Please see the corresponding JSFiddle for the demonstration.
 
We hope it helps.
 
Regards,
Illia

Please login or Register to Submit Answer