I've been trying for days to load a .rtf file into a header.
None of the demos seem to do this. All I can figure out from the examples is how to write a line of text to the header canvas. It's all very cryptic indeed.
Anyone have a simple example of how to load a .rtf file into the header.
And how to turn the header on or off.
I need to give the user the ability to choose different headers from different files at run time.
Cheers
Don
Headers
-
- Site Admin
- Posts: 17521
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Headers
How about an example of using headers with SRichViewEdit and SRVPrint
The example in Assorted/Printing/Headers, along with all the other header examples, deal with regular RichViewEdit and RVPrint. Those examples seem to be very different and I'm sorry to say I can't figure out how to make the transition.
It took me a long time to get the Gnostic PDF engine working with SRichViewEdit so I don't really want to set them back to regular RichView
Here's a perfect world for me
if FileExists(ExeDir+'MedicalTemplates\Header.rtf') then
begin
rvHeader.Clear;
rvHeader.DeleteUnusedStyles(True,True,True);
rvHeader.LoadRTF(ExeDir+'MedicalTemplates\Header.rtf');
rvHeader.Format;
* RVE.SomeCodeToAdd.RVHeader.to.RVE(rvHeader.RVDate);
end;
Cheers
Don
The example in Assorted/Printing/Headers, along with all the other header examples, deal with regular RichViewEdit and RVPrint. Those examples seem to be very different and I'm sorry to say I can't figure out how to make the transition.
It took me a long time to get the Gnostic PDF engine working with SRichViewEdit so I don't really want to set them back to regular RichView
Here's a perfect world for me
if FileExists(ExeDir+'MedicalTemplates\Header.rtf') then
begin
rvHeader.Clear;
rvHeader.DeleteUnusedStyles(True,True,True);
rvHeader.LoadRTF(ExeDir+'MedicalTemplates\Header.rtf');
rvHeader.Format;
* RVE.SomeCodeToAdd.RVHeader.to.RVE(rvHeader.RVDate);
end;
Cheers
Don
-
- Site Admin
- Posts: 17521
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
In TSRichViewEdit, it's even more simple, you do not need external editors.
To load RTF containing headers, just use SRichViewEdit.RichViewEdit.LoadRTF(). If this RTF contains a header and/or a footer, they will be loaded.
If you want to load some document _in_ a header, use SRichViewEdit.RVHeader.LoadRTF().
Note: some versions of ActionTest demos for TSRichViewEdit had rvrtfSaveHeaderFooter mistakenly excluded from SRichViewEdit1.RTFOptions, so they could not save documents with header of footer. Include this option back manually.
To load RTF containing headers, just use SRichViewEdit.RichViewEdit.LoadRTF(). If this RTF contains a header and/or a footer, they will be loaded.
If you want to load some document _in_ a header, use SRichViewEdit.RVHeader.LoadRTF().
Note: some versions of ActionTest demos for TSRichViewEdit had rvrtfSaveHeaderFooter mistakenly excluded from SRichViewEdit1.RTFOptions, so they could not save documents with header of footer. Include this option back manually.