Make sure that TppReport.AllowPrintToArchive is set to True. This property is published so it is saved/restored each time you load a report. Therefore if you have existing reports you will need to use the TppReport.Template.OnLoadEnd event to set this property to true.You can also use the TppReport.Template.OnNew event to initialize new reports so that this property is set to True.
--
Best regards,
Nard Moseley Digital Metaphors www.digital-metaphors.com
1. The Report.AllowPrintToArchive is a published property of TppReport. Therefore the property value is saved down with all reports. When a report loads the TppReport properties are updated with the values saved in the template.
2. To ensure that all new reports default to AllowPrintToArchive value of True, use the Report.Template.OnNew event to intialize this property.
3. To ensure that all existing reports have the AllowPrintToArchive value set to True use the Report.Template.OnLoadEnd event to initialize this property.
The solution would look something like this (Warning: I did not compile or test this).
What I want is ability to save RAF files into database like in EUR solution...and have some tree view structure like in standard EUR.
Let me make more clear let us say there is (in TMyEUR_Raf form) one button which will automaticall print report to database and user should make similar procedure like with classic EUR reports...
Is that possible and what would be the recomendations to make that work in the easiest way...
We do not have any examples of this. You could perhaps copy the source to the Report Explorer and adapt it for these needs.
To store an archive to a database Blob, see the following article...
--------------------------------------------------- Tech Tip: Loading an Archive File to a Blob (or memory stream) ---------------------------------------------------
You can easily write a routine to take a .RAF file and load it into a blob field or a TMemoryStream:
Comments
Make sure that TppReport.AllowPrintToArchive is set to True. This property
is published so it is saved/restored each time you load a report. Therefore
if you have existing reports you will need to use the
TppReport.Template.OnLoadEnd event to set this property to true.You can also
use the TppReport.Template.OnNew event to initialize new reports so that
this property is set to True.
--
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
frankly I do not follow you...
Could You be a little more specific?
THX!
Ben
On Wed, 14 Jul 2004 13:48:08 -0600, Nard Moseley (Digital Metaphors)
1. The Report.AllowPrintToArchive is a published property of TppReport.
Therefore the property value is saved down with all reports. When a report
loads the TppReport properties are updated with the values saved in the
template.
2. To ensure that all new reports default to AllowPrintToArchive value of
True, use the Report.Template.OnNew event to intialize this property.
3. To ensure that all existing reports have the AllowPrintToArchive value
set to True use the Report.Template.OnLoadEnd event to initialize this
property.
The solution would look something like this (Warning: I did not compile or
test this).
Example:
TmyEUReportForm = class(TForm)
private
procedure TemplateOnNewEvent(Sender: TObject);
procedure TemplateOnLoadEndEvent(Sender: TObject);
end;
procedure TmyEUReportForm.FormCreate(Sender: TObject);
begin
myReport.Template.OnNew := TemplateOnNewEvent;
myReport.Template.OnLoadEnd := TemplateOnLoadEndEvent;
end;
procedure TmyEUReportForm.TemplateOnNewEvent(Sender: TObject);
begin
myReport.AllowPrintToArchive := True;
end;
procedure TmyEUReportForm.TemplateOnLoadEndEvent(Sender: TObject);
begin
myReport.AllowPrintToArchive := True;
end;
--
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
now I see that You didn't understand me...
What I want is ability to save RAF files into database like in EUR
solution...and have some tree view structure like in standard EUR.
Let me make more clear let us say there is (in TMyEUR_Raf form) one
button which will automaticall print report to database and user should
make similar procedure like with classic EUR reports...
Is that possible and what would be the recomendations to make that work
in the easiest way...
regards,
Ben
THX!
We do not have any examples of this. You could perhaps copy the source to
the Report Explorer and adapt it for these needs.
To store an archive to a database Blob, see the following article...
---------------------------------------------------
Tech Tip: Loading an Archive File to a Blob
(or memory stream)
---------------------------------------------------
You can easily write a routine to take a .RAF file and
load it into a blob field or a TMemoryStream:
myFileStream := TFileStream.Create('myArhcive.RAF', fmOpenRead);
myFileStream.Position := 0;
myBlobField.LoadFromStream(myFileStream);
myFileStream.Free;
OR
myMemoryStream := TMemoryStream.Create;
{note: passing 0 as the second parameter will copy the entire stream}
myMemoryStream.CopyFrom(myFileStream, 0);
myMemoryStream.Free;
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com