enter image description here

I've managed to create a working ArcGIS Model service and now I'm trying to use it in my silverlight application. The model uses a geoprocessing tool Record set (an excel file). I'm trying to add this parameters like it's done in the Drive time sample.

I don't know how to call the excel file that I need.

  • 1
    Could you provide a snap shot of the model? – Clickinaway May 3 '13 at 17:16
  • 1
    A little more informative title could help as well. – radek May 3 '13 at 17:44

In order to let the model work with the file a user has on his/her computer, you need to pass the file first to the server. You can build your own logic in Silverlight for that or use the new 10.1 Uploads functionality of the geoprocessing services.

My suggestion is to extend your current model to get first an Excel file from user, process it if required, and then use the processed dataset as input for your geocoding process. When you make the input Excel file a model parameter, you will be able to implement the uploads logic within your Silverlight application.

Just as a comment, you can take a look at the ArcGIS Viewer for Flex which has implemented the Uploads functionality as a widget or a sample Esri JavaScript application where one can upload a file to be input for a GP service.

| improve this answer | |

I think that the excel file should be first converted to JSON then used as recordset parametre. like described in this question .

you can convert excel file to json using the suggested scripts here.

| improve this answer | |
  • i have tried this solution but it dosen't work because the parameter in my geoprocessor task must be GPRecordSet and not GPString!! – Geomak May 10 '13 at 8:15

You cannot use an Excel file as an input for a Geoprocessing service. Please see this page: Input and output data types

When you publish a model as a Geoprocessing service, you can have input parameters only in certain formats.

In your case you want to input a table, so your input type should be Recordset. You will have to create a recordset in your Silverlight Application, and will have to pass that as an input to your Geoporcessing query.

| improve this answer | |
  • An Excel file can be actually specified as an input for a GP service when using the Uploads functionality. – Alex Tereshenkov May 6 '13 at 9:27
  • hi again, to import data from excel i have to use a DataSet not a RecordSet, but the only type that can be used in geoprocessing is a RecordSet!!! Have you any idea?? – Geomak May 10 '13 at 8:19
  • As per my understanding, the input can only be a file via uploads or a Recordset. In either of the two cases,it is ur responsibility as a developer to get the data out and process it. Unfortunately I 'm not an expert at silverlight, but I would try and see if there was some way to read and process an excel file. Once you have the data, you can create a fresh Recordset. And the pass it to the go service. – Devdatta Tengshe May 10 '13 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.