Index: cprs/trunk/CPRS-Chart/fReportsPrint.pas
===================================================================
--- cprs/trunk/CPRS-Chart/fReportsPrint.pas	(revision 456)
+++ cprs/trunk/CPRS-Chart/fReportsPrint.pas	(revision 830)
@@ -5,8 +5,9 @@
 uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
-  StdCtrls, fAutoSz, ORCtrls, ORNet, Mask, ComCtrls, rECS;
+  StdCtrls, fAutoSz, ORCtrls, ORNet, Mask, ComCtrls, rECS,
+  fBase508Form, VA508AccessibilityManager;
 
 type
-  TfrmReportPrt = class(TfrmAutoSz)
+  TfrmReportPrt = class(TfrmBase508Form)
     lblReportsTitle: TMemo;
     lblPrintTo: TLabel;
@@ -21,5 +22,4 @@
     dlgWinPrinter: TPrintDialog;
     chkDefault: TCheckBox;
-    procedure FormCreate(Sender: TObject);
     procedure cboDeviceChange(Sender: TObject);
     procedure cmdOKClick(Sender: TObject);
@@ -27,5 +27,4 @@
     procedure cboDeviceNeedData(Sender: TObject; const StartFrom: String;
       Direction, InsertAt: Integer);
-    procedure FormDestroy(Sender: TObject);
     procedure FindVType;
 
@@ -50,5 +49,6 @@
 {$R *.DFM}
 
-uses ORFn, rCore, uCore, fReports, rReports, uReports, Printers, fFrame;
+uses ORFn, rCore, uCore, fReports, rReports, uReports, Printers, fFrame,
+  VAUtils;
 
 const
@@ -75,5 +75,5 @@
   frmReportPrt := TfrmReportPrt.Create(Application);
   try
-    ResizeFormToFont(TForm(frmReportPrt));
+    ResizeAnchoredFormToFont(TForm(frmReportPrt));
     with frmReportPrt do
     begin
@@ -170,5 +170,5 @@
                    (not (piece(uColumns[StrToInt(piece(aCol,':',2))],'^',4) = '1')) then
                     begin
-                      aBasket.Assign(TCellObject(RowObjects.ColumnList[j]).Data);
+                      FastAssign(TCellObject(RowObjects.ColumnList[j]).Data, aBasket);
                       for k := 0 to aBasket.Count - 1 do
                         begin
@@ -199,5 +199,5 @@
                     begin
                       aWPFlag := true;
-                      aBasket.Assign(TCellObject(RowObjects.ColumnList[j]).Data);
+                      FastAssign(TCellObject(RowObjects.ColumnList[j]).Data, aBasket);
                       //frmReports.MemText.Lines.Add(TCellObject(RowObjects.ColumnList[j]).Name);
                       FReportText.Lines.Add(TCellObject(RowObjects.ColumnList[j]).Name);
@@ -247,16 +247,4 @@
 end;
 
-procedure TfrmReportPrt.FormCreate(Sender: TObject);
-begin
-  inherited;
-  FReportText := TRichEdit.Create(Self);
-  with FReportText do
-    begin
-      Parent := Self;
-      Visible := False;
-      Width := 600;
-    end;
-end;
-
 procedure TfrmReportPrt.cboDeviceChange(Sender: TObject);
 begin
@@ -283,4 +271,5 @@
 begin
   inherited;
+  FReportText := CreateReportTextComponent(Self);
   RemoteSiteID := '';
   RemoteQuery := '';
@@ -320,6 +309,6 @@
                           aQualifier := ListItem.SubItems[0];
                           ADevice := Piece(cboDevice.ItemID, ';', 2);
-                          Lines.Assign(GetFormattedReport(FReports, aQualifier,
-                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState));
+                          QuickCopy(GetFormattedReport(FReports, aQualifier,
+                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState), FReportText);
                           aCaption := piece(uRemoteType,'^',4);
                           PrintWindowsReport(FReportText, PAGE_BREAK, aCaption, ErrMsg);
@@ -335,6 +324,6 @@
                           aQualifier := ListItem.SubItems[0];
                           ADevice := Piece(cboDevice.ItemID, ';', 2);
-                          Lines.Assign(GetFormattedReport(FReports, aQualifier + MoreID,
-                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState));
+                          QuickCopy(GetFormattedReport(FReports, aQualifier + MoreID,
+                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState), FReportText);
                           aCaption := piece(uRemoteType,'^',4);
                           PrintWindowsReport(FReportText, PAGE_BREAK, aCaption, ErrMsg);
@@ -349,5 +338,5 @@
                         aReport.Clear;
                         CreatePatientHeader(aReport,piece(uRemoteType,'^',4));
-                        FReportText.Lines.Assign(aReport);
+                        QuickCopy(aReport, FReportText);
                         FindVType;
                         aCaption := piece(uRemoteType,'^',4) + ';1';
@@ -357,6 +346,6 @@
                     else
                       begin
-                        Lines.Assign(GetFormattedReport(FReports, aQualifier + MoreID,
-                          Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState));
+                        QuickCopy(GetFormattedReport(FReports, aQualifier + MoreID,
+                          Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState), FReportText);
                         aCaption := piece(uRemoteType,'^',4);
                         PrintWindowsReport(FReportText, PAGE_BREAK, aCaption, ErrMsg);
@@ -371,5 +360,5 @@
                         aReport.Clear;
                         CreatePatientHeader(aReport,piece(uRemoteType,'^',4));
-                        FReportText.Lines.Assign(aReport);
+                        QuickCopy(aReport, FReportText);
                         FindVType;
                         aCaption := piece(uRemoteType,'^',4) + ';1';
@@ -379,6 +368,6 @@
                     else
                       begin
-                        Lines.Assign(GetFormattedReport(FReports, aQualifier + MoreID,
-                           Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState));
+                        QuickCopy(GetFormattedReport(FReports, aQualifier + MoreID,
+                           Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState), FReportText);
                         aCaption := piece(uRemoteType,'^',4);
                         PrintWindowsReport(FReportText, PAGE_BREAK, aCaption, ErrMsg);
@@ -394,6 +383,6 @@
                           aQualifier := ListItem.SubItems[0];
                           ADevice := Piece(cboDevice.ItemID, ';', 2);
-                          Lines.Assign(GetFormattedReport(FReports, aQualifier,
-                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState));
+                          QuickCopy(GetFormattedReport(FReports, aQualifier,
+                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState), FReportText);
                           aCaption := piece(uRemoteType,'^',4);
                           PrintWindowsReport(FReportText, PAGE_BREAK, aCaption, ErrMsg);
@@ -409,6 +398,6 @@
                           aQualifier := ListItem.SubItems[0];
                           ADevice := Piece(cboDevice.ItemID, ';', 2);
-                          Lines.Assign(GetFormattedReport(FReports, aQualifier,
-                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState));
+                          QuickCopy(GetFormattedReport(FReports, aQualifier,
+                            Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState), FReportText);
                           aCaption := piece(uRemoteType,'^',4);
                           PrintWindowsReport(FReportText, PAGE_BREAK, aCaption, ErrMsg);
@@ -422,10 +411,10 @@
               if (Pos('OR_ECS1',FReports)>0) or (Pos('OR_ECS2',FReports)>0) then
               begin
-                ShowMessage('The Event Capture report can only be printed by Vista printer.');
+                ShowMsg('The Event Capture report can only be printed by Vista printer.');
                 Exit;
               end;
               aQualifier := Piece(uRemoteType,'^',5);
-              Lines.Assign(GetFormattedReport(FReports, aQualifier,
-                 Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState));
+              QuickCopy(GetFormattedReport(FReports, aQualifier,
+                 Patient.DFN, uHSComponents, RemoteSiteID, RemoteQuery, uHState), FReportText);
               aCaption := piece(uRemoteType,'^',4);
               PrintWindowsReport(FReportText, PAGE_BREAK, aCaption, ErrMsg);
@@ -473,5 +462,5 @@
                     FindVType;
                     aReport.Clear;
-                    aReport.Assign(FReportText.Lines);
+                    QuickCopy(FReportText.Lines, aReport);
                     ADevice := Piece(cboDevice.ItemID, ';', 2);
                     PrintVReports(ErrMsg, ADevice, piece(uRemoteType,'^',4),aReport);
@@ -493,5 +482,5 @@
                     FindVType;
                     aReport.Clear;
-                    aReport.Assign(FReportText.Lines);
+                    QuickCopy(FReportText, aReport);
                     ADevice := Piece(cboDevice.ItemID, ';', 2);
                     PrintVReports(ErrMsg, ADevice, piece(uRemoteType,'^',4),aReport);
@@ -559,4 +548,5 @@
   User.CurrentPrinter := cboDevice.ItemID;
   aReport.Free;
+  FReportText.Free;
   Close;
 end;
@@ -575,10 +565,4 @@
 end;
 
-procedure TfrmReportPrt.FormDestroy(Sender: TObject);
-begin
-  FReportText.Free;
-  inherited;
-end;
-
 end.
 
