Export to Excel without a table
I found myself wanting to create a blank hidden table today just to use the export to excel function. Is there a way to create a button to export all the fields from a model using the same functionality as the table export? (just without the table)
1
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
var model = skuid.model.getModel('MyModel');
model.exportData({
fileName: 'MyFile',
fields: [
model.getField('Name'),
model.getField('BillingCountry'),
model.getField('Industry'),
model.getField('Owner.Name')
]
});
I have a customer who wants to export data and when using the Excel export option she can not pull all data without having to use the More button and with thousands of records it takes a long time. What she is trying to do is export data to excel based on criteria to create a custom report in excel. Would the above example work for this use case or is there a better way for her to do this? She can only set the model to show about 500 records at a time before she throws an error using the table.
I have another question related to the exportData method. This functionality has been very beneficial in allowing us to export data that has not yet been saved in the model.
Is there a condition that can be set when calling the method so leading zeros in text fields are not truncated? We have department numbers like "000220" that are converted to "220" when exported.
Thanks for your help.
We have implemented a custom export button that calls the exportData() method on our model, the problem is our customer requested for the record ID to not be included in the exported file. I have tried including the fields parameter with the hopes it would only export the fields I specified, but the record Id is still appended to each row in the generated export file. I know you can remove the option to "append record id column" for the standard export button on a table, but is there a way to turn off this option via a parameter in the exportData() method?
Thank you.
Do I need to use the solution above rather than the standard export to excel functionality?
Thanks!
var model = skuid.model.getModel('MyModel');
model.exportData({
fileName: 'MyFile',
fields: [
model.getField('Name'),
model.getField('User__r.Name'),
model.getField('Account__r.Name')
]
});
My users are asking for a way to export the table data but choose different fields depending on the scenario. Any ideas I can run with let me know.
This post is extremely helpful! Thanks all...
Then in the JavaScript, if there's some way to "get all the fields in this model", you could iterate through the fields. I'm not at all a JS developer, but here's the kind of code I would try, after getting all the fields in a given model in an array called modelFields (not even sure THAT is possible)
I also used :
var model = skuid.model.getModel('LeadData');
I got it answer here:
Before you can reliably use the <skuid:page> Visualforce (VF) component approach, there is a post-install configuration step you will need to take to guarantee that your Skuid Pages will behave exactly the same as they would if you were taking the Redirect approach:
You must find the following 3 VF Pages that come in the Skuid app / managed package, and create a local clone of each of them with the exact same name:
- ExportData
- UploadImage
- Include
http://help.skuidify.com/m/page-assignments-and-overrides/l/201793-using-the-skuid-page-visualforce-component-to-run-skuid-pagesThanks,
Rajendra
Check out-> loadAllRemainingRecords
https://docs.skuid.com/latest/en/skuid/api/skuid_model_model.html
Thanks,
Bill
H/T to skuid support for unofficially helping with this
Note: "Index" is a UI-Only field I made with the formula {{index}}, which gives you the row number in a column.