Metadata stylesheet

455
2
03-12-2013 10:19 AM
CarlosPiccirillo
New Contributor III
Hi everyone,

I am converting C# code from ArcGIS 9.3 to 10.1 and have hit a wall trying to set the metadata stylesheet in code. In 9.3 the code to change the stylesheet was:

IMetadataViewWindow metadataWindow = new MetadataViewWindowClass();
metadataWindow.Layer = pLayer;
metadataWindow.Application = m_application;
metadataWindow.DataSource = pDataLayer.DataSourceName as IDatasetName;
metadataWindow.MetadataHelper.Stylesheet = "FGDC ESRI";

The main problem is that the Stylesheet property on the IMetadataViewWindow interface is read only in 10.1 where it used to be read/write in 9.3.

My attempt at the 10.1 code using the IMetadataHelper Stylesheet Example is:

IExtension pExtension = m_application.FindExtensionByName("ESRI Metadata Extension") as IExtension;
IMetadataHelper pMetadataHelper = pExtension as IMetadataHelper;
pMetadataHelper.Stylesheet = "ARCGIS";

I also tried pMetadataHelper.Stylesheet = "FGDC ESRI"; and pMetadataHelper.Stylesheet = "FGDC CSDGM Metadata";

The code produces no errors but it does not work either.

Opening some metadata after running the code produces the default "Item Description" metadata style. I can change it manually by going to Customize > Options and on the Metadata tab choose the style I want but I need to do this in code because most of the users accessing our code are not very ArcGIS literate so the more things I can automate, the better.

I have looked through the old forums as well as the new ones and found very few posts dealing with metadata.

Thanks for your time,
Carlos
0 Kudos
2 Replies
OttoArturo
New Contributor
Hello Carlos,

I am dealing with same problem. May I email you? It is just because I think you speak Spanish and that is my language.

Thank you in advantage,

Otto Arturo.
0 Kudos
CarlosPiccirillo
New Contributor III
Yes Otto, you can email me at cpicciri@sfwmd.gov if you wish. Yes, I speak Spanish. Unfortunately, I have not found a solution to the problem.

Hello Carlos,

I am dealing with same problem. May I email you? It is just because I think you speak Spanish and that is my language.

Thank you in advantage,

Otto Arturo.
0 Kudos