Wednesday, July 21, 2010

More on Generating Excel and Word with Python

The best way to figure out what you want to do with excel and word in python is to look at the VBA object model.  Find the information here:
VBA Samples: http://technet.microsoft.com/en-us/library/ee692929.aspx
Excel: http://msdn.microsoft.com/en-us/library/aa269683(v=office.10).aspx
Word: http://msdn.microsoft.com/en-us/library/aa279125(v=office.10).aspx
 
Enjoy

Tuesday, July 20, 2010

MS Word and Python - Helpful links

Recently I was asked to develop a geoprocessing script that creates a MS Word Doc.  Here were some links that helped me out:
http://www.blog.pythonlibrary.org/2010/07/16/python-and-microsoft-office-using-pywin32/
http://libjoe.blogspot.com/2009/07/embedding-images-in-word-pythoncvb.html
http://win32com.goermezer.de/content/category/7/86/192/
http://code.activestate.com/recipes/279003/
http://www.daniweb.com/forums/thread129924.html

This is for excel:
http://www.python-excel.org/


Enjoy Everyone!

Wednesday, July 7, 2010

Web ADFs Will be Deprecated

The future of the Web AdfDF has been written on the wall.  It shall be put to rest after version 10 of ArcGIS Server.  Also, many of the new features like time awareness and feature service usage will not be supported at 10.

Check it out here.

Wednesday, June 23, 2010

Question for readers

I want to hear from you, leave a comment answering this question:

How do you envision GIS being used with SharePoint?

Thanks

Thursday, June 10, 2010

Spatial Web Parts with Silverlight in SharePoint 2010

In SharePoint 2010 (SP2010) you can create a silverlight web part pretty easy by just creating a custom control, then deploy the XAP file to the clientbin folder.  I should note that the pre-canned silverlight web part that I am using does not allow for DCOM bridges to be used, so to communicate between multiple silverlight web parts you would have to the Messaging API, which is quite easy, but that's for another day.

Getting Started, Open Visual Studios 2010, and create an empty SharePoint Project and a Silverlight Application.  For the Silverlight Application project ensure that the "Host the Silverlight Application in the new Web Site" is unchecked.

Now we are cooking with fire, and we can create our Silverlight application.  For this example, I will just add a map and one layer to the project. 
The next step is to place the XAP file in a location that can be used by SharePoint.  Right click on the Silverlight Application we just created and select Properties.  Click on the build tab and change the output path to: "..\..\..\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin\".  Remove the quotes when you put this into the Output Path.

Save and compile the project.  If you get any errors, it's most likely you need to reference the proper ESRI silverlight libaries.
The next step is to configure the SharePoint Project. Add a new item to the SharePoint project and select Module. Double click on the Elements.xml file.

Configure the elements file to match the above image, you need to change the path of the Url to "_layouts/clientsbin/ XAPFILENAME.XAP" and change the Path from the textfile name to the XAP file name.

Click on the module and select the Project Output Refer -> Add a member -> Choose the Silverlight Application name -> in the Deployment Type Select ElementFile -> press OK
Select Build From main toolbar -> Configuration Manager -> Uncheck all the builds except for the SharePoint Project Name and make sure the SharePoint Project has deploy checked.

Save the Project and deploy to SharePoint. 

Open your SharePoint site -> Edit Page -> Add Silverlight Web Part -> enter in the text box the following "_layouts/clientbin/XAPFILENAME.XAP".  You should now see your web part.

Tuesday, May 11, 2010

Serialization With Silverlight

Say you want to serialize an object using silverlight, well you can't use the binaryformater() like in windows forms development, so what to do.  Silverlight has a the DataContractSerializer class which "Serializes and deserializes an instance of a type into an XML stream or document using a supplied data contract."  So this means that you are passing XML string data.

From the windows help: "Use the DataContractSerializer class to serialize and deserialize instances of a type into an XML stream or document. For example, you can create a type named Person with properties that contain essential data, such as a name and address. You can then create and manipulate an instance of the Person class and write all of its property values in an XML document for later retrieval, or in an XML stream for immediate transport."


Here is my code:
Enjoy

Getting Started with Geoprocessing and ArcObjects in .NET

Not a programmer and don't know where to start?
Here is a great "how to get started" article for from ArcUser magazine.

Enjoy