From 969485ed402b2d17be57342be0c87a0c467f6548 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 24 Aug 2011 11:46:39 +0000 Subject: [PATCH] --- PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index de537553..42c8c774 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -37,7 +37,7 @@ namespace VEPROMS.CSLA.Library if (roids.Contains(roidkey)) roids.Remove(roidkey);// If in both, nothing to do else - myUsage.Delete(); // If only in old, remove it + myUsage.MyDROUsage.Delete(); // If only in old, remove it } } foreach (string roidkey in roids) @@ -584,6 +584,7 @@ namespace VEPROMS.CSLA.Library RectangleF plotRect = CreatePlot(pngFile, val, 600F, FormForPlotGraphics); //LBShape shape = myDoc.Shapes.AddPicture(@"C:\Temp\XYPlot.png", 0, 0, sel.Range); float x = (float)sel.get_Information(LBWdInformation.wdHorizontalPositionRelativeToPage); + float y = (float)sel.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage); //LBInlineShape shape = sel.InlineShapes.AddPicture(pngFile); LBRange myRange = sel.Paragraphs.First.Range; @@ -591,6 +592,11 @@ namespace VEPROMS.CSLA.Library float yTop1 = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToTextBoundary); float xAdjust = (float)-sect.MyDocStyle.Layout.LeftMargin; float yAdjust = sel.Font.Size; + // The following two lines made the xyplot location for WCN2 match the 16bit output. However, how the + // xTweak value is determined is phantom of Rich's mind. Word document location of the RO token + // will be modified in data before delivery so that this xTweak is not needed. + //float xTweak = -(30 + xAdjust) / 3; // Used to align plots for WCN2. + //LBShape shape = myDoc.Shapes.AddPicture(pngFile, x + xAdjust + plotRect.X + xTweak, yAdjust + y - yTop + plotRect.Y, sel.Range); LBShape shape = myDoc.Shapes.AddPicture(pngFile, x + xAdjust + plotRect.X, yAdjust + y - yTop + plotRect.Y, sel.Range); File.Delete(pngFile); shape.LockAspectRatio = LBMsoTriState.msoTrue;