From 42e70515c635e3b5acea0316ceda0c07b989112c Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 9 Mar 2012 14:11:05 +0000 Subject: [PATCH] --- .../Extension/DocumentExt.cs | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index 7af6da05..1851c21d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -538,10 +538,20 @@ namespace VEPROMS.CSLA.Library //PageStyle myPageStyle = myDocStyle.pagestyle; ProcedureInfo proc = sect.MyProcedure; DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo; - ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst; - ROFSTLookup lookup = rofst.ROFSTLookup; - string igPrefix = dvi.DocVersionConfig.RODefaults_graphicsprefix; - string spPrefix = dvi.DocVersionConfig.RODefaults_setpointprefix; + bool hasRos = false; + ROFstInfo rofst = null; + ROFSTLookup lookup = null; + string igPrefix = null; + string spPrefix = null; + + if (dvi.DocVersionAssociationCount > 0) + { + hasRos = true; + rofst = dvi.DocVersionAssociations[0].MyROFst; + lookup = rofst.ROFSTLookup; + igPrefix = dvi.DocVersionConfig.RODefaults_graphicsprefix; + spPrefix = dvi.DocVersionConfig.RODefaults_setpointprefix; + } // string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid); using (DSOFile myFile = new DSOFile(sect.MyContent.MyEntry.MyDocument)) { @@ -565,7 +575,7 @@ namespace VEPROMS.CSLA.Library } LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName, false); AdjustMargins(myDocStyle, myDoc, true); - LBSelection selxy = FindXyPlot(); + LBSelection selxy = hasRos ? FindXyPlot() : null; while (selxy != null) { string xyplot = selxy.Text; @@ -588,7 +598,7 @@ namespace VEPROMS.CSLA.Library selxy.WholeStory(); selxy = FindXyPlot(); } - LBSelection sel = FindRO(); + LBSelection sel = hasRos ? FindRO() : null; while (sel != null) { string val = lookup.GetROValueByAccPagID(sel.Text, spPrefix, igPrefix);