Change Preview: Let User change elements.
dschuch
Dresden,Germany
Hy,
we want to realize the following scenario:
A user should change the preview, without having the full "Edit Preview", because its to complicated.
Esp. the user should be able to delete elements from the preview, before the report is printed/send by email.
So we tried out the following possibilities:
In FR, we made a red Shape around the elemets, the user can change. So for example a Logo and a Signature, so if the user click on that element, the element should hide. We made a Event like the following, the MessageBox is working but the element is still there.
That wasnt working, so we tried out it in Delphi:
We made a Dialog, that is shown besides the Preview. Inside the Dialog, we made some Buttons: Hide element1, hide element2 and so on. Inside Delphi, we used the code:
But its not working at all.
There has to be a way: if i go to the build-in editmode of the preview, delete an object, close edit preview and say "yes, save changes to preview", its working. so what we have to do, to let FR rebuild the preview page?
Daniel.
we want to realize the following scenario:
A user should change the preview, without having the full "Edit Preview", because its to complicated.
Esp. the user should be able to delete elements from the preview, before the report is printed/send by email.
So we tried out the following possibilities:
In FR, we made a red Shape around the elemets, the user can change. So for example a Logo and a Signature, so if the user click on that element, the element should hide. We made a Event like the following, the MessageBox is working but the element is still there.
procedure ShapeHideLogoClickOnPreviewDblClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
begin
ShowMessage('Test');
MyTfrxPictureView.Visible:=False;
end;
That wasnt working, so we tried out it in Delphi:
We made a Dialog, that is shown besides the Preview. Inside the Dialog, we made some Buttons: Hide element1, hide element2 and so on. Inside Delphi, we used the code:
if Assigned(frxReport1.PreviewPages.Page[0].FindObject('BackGroundPicture')) then
frxReport1.PreviewPages.Page[0].FindObject('BackGroundPicture').Free;
But its not working at all.
There has to be a way: if i go to the build-in editmode of the preview, delete an object, close edit preview and say "yes, save changes to preview", its working. so what we have to do, to let FR rebuild the preview page?
Daniel.
Comments
I think you must re-run the report to make changes apply. You can store your choice of visibility in a variable, and then act according to this variable when report is run.
Remember also to declare 'MyPicVisibleVar' in the Report|Variables...