Ignore:
Timestamp:
Jan 19, 2010, 1:26:10 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Fixed HTML Note Printing Error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/tmg-cprs/CPRS-Chart/fNotePrt.pas

    r541 r671  
    216216
    217217  if cboDevice.ItemID = '' then
     218  begin
     219    InfoBox(TX_NODEVICE, TX_NODEVICE_CAP, MB_OK);
     220    Exit;
     221  end;
     222  if radChartCopy.Checked then ChartCopy := True else ChartCopy := False;
     223  if Piece(cboDevice.ItemID, ';', 1) = 'WIN' then
     224(*
     225    //begin original block of code from before 5-24-05 
     226    //----------------------------------------------
     227    begin
     228      if dlgWinPrinter.Execute then with FReportText do
     229        begin
     230          Lines.Assign(GetFormattedNote(FNote, ChartCopy));
     231          PrintWindowsReport(FReportText, PAGE_BREAK, Self.Caption, ErrMsg);
     232          if Length(ErrMsg) > 0 then InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
     233        end;
     234    end
     235    //end original unmodified block of code //kt 5-24-05
     236    //--------------------------------------------------
     237*)
     238    //begin modified block of code //kt 5-31-05
     239    //----------------------------------------------
     240    begin
     241      TempLines := TStringList.Create;
     242      TempLines.Assign(GetFormattedNote(FNote, ChartCopy));
     243      if rHTMLTools.IsHTML(TempLines) = false then begin
     244        //NOTE: If HTML, then bypass this printer dialog, because it will be
     245        //      replaced by a printer dialog that internet explorer uses.
     246        if dlgWinPrinter.Execute then begin
     247          FReportText.Lines.Assign(TempLines);
     248          PrintWindowsReport(FReportText, PAGE_BREAK, Self.Caption, ErrMsg,Application);
     249        end; 
     250      end else begin
     251        LoadDocumentText(TempLines, FNote);  //Get document without headers/footers         
     252        PrintHTMLReport(TempLines, ErrMsg, Patient.Name,
     253                        FormatFMDateTime('mm/dd/yyyy', Patient.DOB),
     254                        rHTMLtools.ExtractDateOfNote(TempLines), // date for report.
     255                        Patient.WardService, Application);   
     256      end;
     257      TempLines.Free;
     258      if Length(ErrMsg) > 0 then InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
     259    end
     260    //end modified block of code //kt 5-31-05
     261    //----------------------------------------------
     262  else
     263    begin
     264      ADevice := Piece(cboDevice.ItemID, ';', 2);
     265      PrintNoteToDevice(FNote, ADevice, ChartCopy, ErrMsg);
     266      if Length(ErrMsg) > 0 then InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
     267
     268{*   Original Block of Code    //elh  1/19/10
    218269     begin
    219270     InfoBox(TX_NODEVICE, TX_NODEVICE_CAP, MB_OK);
     
    245296        LoadDocumentText(TempLines, FNote);  //Get document without headers/footers      //kt 8/09
    246297        PrintHTMLReport(TempLines, ErrMsg, Patient.Name,                        //kt 8/09
    247                         FormatFMDateTime('mm/dd/yyyy', Patient.DOB),            //kt 8/09
     298                        FormatFMDateTime('mm/dd/yyyy', Patient.DOB),' ',        //kt 8/09
    248299                        Patient.WardService, Application);                      //kt 8/09
    249300      end;                                                                      //kt 8/09
     
    257308    if Length(ErrMsg) > 0 then
    258309        InfoBox(ErrMsg, TX_ERR_CAP, MB_OK);
     310*}   // End of original block of code   //elh 1/19/10
    259311    end;
    260312
Note: See TracChangeset for help on using the changeset viewer.