Featureset to Excel
I'm working on a workflow that, amongst other things, will create an Excel spreadsheet from a featureset using Workflow Designer 2.13.0.105 and Geocortex Essentials 3.9. There are conversion activities that convert from datatable to XLS or dataset to XLS, but not featureset to XLS. Once I have my featureset defined in a variable, fsParcelInfo, how do I get this workflow to output this as an Excel spreadsheet?
Thanks
Mark
-
Hi Mark,
You can use the FeatureSetToDataTable activity to get a DataTable from your FeatureSet. Then you can pass the DataTable to the DataTableToXls activity.
--Ryan
0 -
Thanks, Ryan. That works.
As a follow-up what is the best way to combine the results of three query tasks? Each of them is executed against a different Query Service Url but they return results that can be combined. The first query task returns PLID, PID, PCLLINKSID, DESCRIPT as its out fields. The next returns PLID, FULLADDR as its out fields, and the third returns PLID, OWNER as its out fields. I want to join these side by side to create a single Excel spreadsheet of all these columns. As you can see the PLID is a key field that can be used to combine them.
Should I combine them at the featureset stage, at the datatable stage or at the Excel spreadsheet stage? The datatable class has a Columns.Add method that might work to create a master datatable, if I can get the column names. Would this be the best way?
Thanks
Mark
0 -
Hi Mark,
I'd have a look at the DataTable.Merge method (http://msdn.microsoft.com/en-us/library/system.data.datatable.merge.aspx) http://msdn.microsoft.com/en-us/library/system.data.datatable.merge.aspx . It sounds like it will do what you're after.
You'll need to use the InvokeMethod activity to do this. This is a very programmer oriented activity.
- Drag in an InvokeMethod activity.
- Leave the TargetType set to null.
- Set the TargetObject to the variable that holds your first DataTable.
- Set the MethodName to Merge.
- Click the button to open the Parameters dialog (from the properties window of this activity).
-
Create a new Argument
- Set the Direction to In.
- Set the Type to DataTable.
- Set the Value to the variable that holds your second DataTable.
This will invoke:
dataTable1.Merge(dataTable2)
--Ryan
0 -
Hi Ryan
I did notice that Merge method but thought it was for just adding new rows. However it looks it can be used to add new columns to a datatable too, but only if the overloaded method is used:
Merge(DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction)
If I set the missingSchemaAction to System.Data.MissingSchemaAction.Add then this should add the new columns. Should Workflow Designer be able to handle overloaded methods? It allows me to put in the three parameters but then gives a red exclamation mark against the InvokeMethod saying "Datatable does not have a public instance named Merge matching the parameter types, generic type arguments and generic type constraints supplied."
How do I deal with this?
Mark
0 -
Hi Mark
It sounds like the type or order of your parameters is incorrect. This worked for me.
/customer/servlet/servlet.FileDownload?file=00P6000000e88FJEAY
--Ryan
0
Please sign in to leave a comment.
Comments
5 comments