TryExportToNodeXLGraphGallery
(
Microsoft.Office.Interop.Excel.Workbook oWorkbook,
NodeXLControl oNodeXLControl
)
{
Debug.Assert(oWorkbook != null);
Debug.Assert(oNodeXLControl != null);
ExportToNodeXLGraphGalleryUserSettings
oExportToNodeXLGraphGalleryUserSettings =
new ExportToNodeXLGraphGalleryUserSettings();
String sAuthor, sPassword;
GetGraphGalleryAuthorAndPassword(
oExportToNodeXLGraphGalleryUserSettings, out sAuthor,
out sPassword);
// Note that a graph summary is used for the description.
try
{
(new NodeXLGraphGalleryExporter()).ExportToNodeXLGraphGallery(
oWorkbook,
oNodeXLControl,
GraphTitleCreator.CreateGraphTitle(oWorkbook),
GraphSummarizer.SummarizeGraph(oWorkbook),
oExportToNodeXLGraphGalleryUserSettings.SpaceDelimitedTags,
sAuthor,
sPassword,
oExportToNodeXLGraphGalleryUserSettings
.ExportWorkbookAndSettings,
oExportToNodeXLGraphGalleryUserSettings.ExportGraphML,
oExportToNodeXLGraphGalleryUserSettings.UseFixedAspectRatio
);
return(true);
}
catch (Exception oException)
{
String sMessage;
if (NodeXLGraphGalleryExceptionHandler
.TryGetMessageForRecognizedException(
oException, out sMessage))
{
FormUtil.ShowWarning(sMessage);
}
else
{
ErrorUtil.OnException(oException);
}
return(false);
}
}