trichview.support
Print/Preview vs normal on-screen mode, Header (show/hide) |
Author |
Message |
dk_sz |
Posted: 02/03/2004 18:35:45 So, after trying other things (and not getting them to work) I decided a solution could be: When prining/previewing I delete(or-hide?) my own "document-header" and enable the "page-header" for printing. When back in normal mode re-insert/add my "document header". The reason is that my "document-header" and "page-header" are the same! However, how do I ensure inserting my "document headers" are inserted/added to top of document? Any built-in way of doing this? Here's some code I've written: //-------------------------------------------------------------------------- ---- procedure TfrmForbugt.UpdateHeaderInDocument(AKeep: Boolean); begin if AKeep = False then begin if FPageHeadersInDocument then begin // RichView.ItemCount is always minimum 1 (tested e.g. "Form.OnCreate") rveDataOutput.DeleteItems(1, FPageHeaderItemCount); rveDataOutput.Format; FPageHeadersInDocument := False; FPageHeaderItemCount := 0; end; end else begin if FPageHeadersInDocument = False then begin if rveDataOutput.ItemCount > 1 then begin rveDataOutput.AddNL(FPageHeaderPeriod, 0, 0); rveDataOutput.AddNL(FPageHeaderPrintDateTime, 0, 0); rveDataOutput.AddBreak; rveDataOutput.AddNL('', 0, 0); rveDataOutput.AddNL('', 0, 0); rveDataOutput.Format; FPageHeadersInDocument := True; FPageHeaderItemCount := 5; end; end; end; end; It should be said that I am actually using richview in "viewer" mode (i.e. I am not using any, to my knowledge at least, "editor" functions). If there's another way of achiving what I desire, I am open for suggestions! best regards Thomas Schulz |
Powered by ABC Amber Outlook Express Converter