We are using mvc .net as much as possible, and datasourceurl and updateurl with remote features. We are attempting to do an export that talks to the server then export a file. Is there a way that we can get the same query string passed into the controller when the updateURL callback is called? We are making the initial call in javascript, so we have access to the grid.
I can get the current filter expressions like this:
var gridFilteringExpressions = grid.data("igGrid").dataSource.settings.filtering.expressions;
And I can create my own custom queryString. I want the actual string that infragistics passes when updateURL is called, as its already formatted and contains other things like sorting.
Please advise if there is a way to do this.
Thanks
Hello,
Thank you for contacting Infragistics!
I have some questions concerning this matter. What are you trying to do with this information before you export? What are you trying to achieve? Are you trying to pass this information onto the export?
Hi,
In order for me to get all the data from the server I need to pass the filters (like whats passed in on updateURL query string) to the service so it can get all the data based on the filters, and with the data I retrieve I need to export this to excel.
We are using paging and getting small sets of data at a time for viewing on the grid, with dataSourceUrl, so the client only has a small subset of data locally at a time. For the export I need all the data based on filters. When user clicks the export button it will get all the data from the server based on filters then download the excel in users browser.
Is there a better way to accomplish this?
Thank you for the update. I would instead using our Grid Excel Exporter:
http://www.igniteui.com/help/iggridexcelexporter-overview
It exports from the client so it already takes into effect any sort of sorting, filtering, paging you have on the grid. As you can see in the following sample:
http://www.igniteui.com/grid/export-client-events
Please let me know if you have any further questions concerning this matter.
Hi Mike,
Thanks for responding. We are using remote server side paging/filtering etc, so at anytime we may only have a handful of records in the grid, not the entire data set. Since the iggridexcelexporter is a client side export, will this be capable of getting all of the data not currently present in the grid, from the server, to export 100,000's of records from server side with the filter, as opposed to just the records currently in the iggrid in the client browser? From what I understood that exporter is client side only, meaning it will only export the contents inside the grid at the time you export. Is this correct? Usually the grid only contains 10-1000 records client side, but the server may have 1 million + records. We need the entire data set with filters from the server.
I have done some further looking into this matter and there isn’t a way to get filter settings once on the server from the url/method call. Instead what you will want to do it handle the filtering event on the client side and set it to var that can be passed back to the server. You can see an example of this with the paging behavior in the following sample:
http://www.igniteui.com/infragistics-excel/create-excel-worksheet
As for handling the filtering event on the client and set it to var that can be passed back to server, I don't see an example of this in the link your provided.
I see this call to export, although I don't see at a glance how the view knows to call this action as it is not directly referenced that I can see. How would you pass more parameters to this call, as this would seem what you are suggesting?
[HttpPost] [ActionName("create-excel-worksheet")] public void ExcelExporter(int pageNumber, int pageSize, bool exportType, bool exportFormat) In addition if I was to handle the filtering event on the client and set it to a var, what exactly from the filtering event would I be capturing? Is there a query string available here like the one passed to the getDataUrl?
Thank you for the update. The controller knows to export because the input/button used for the export button is a submit button which is in a form. So it pulls the information from the inputs in the form. If you wanted the filtering information you would use the dataFiltered client side event to get the filter information, as you can see it in the following link it has the column key, column index which ever you prefer as well as the expressions from the datasource:
http://help.infragistics.com/jQuery/2015.2/ui.iggridfiltering#events:dataFiltered
The ui.expressions is an array of the filtered expressions for example if you have a text column that is filtered with the condition “contains” and the text/expression “b” you would see the following in the array:
ui.expressions[0]. then off the array the following properties
cond : "contains" datatype : "string" expr : "b" fieldname : "Name"