Topic: FastReport Edit Page

Hi all,
I just noticed that in my FastReports they have an ICON called "Edit Page".
I would like to disable this icon if possible.
.
I use the Preview setting in my reports so the user can see what the report will look like, then they can use the option ICONS that are available to print..etc the report.
.
But the Edit Page ICON allows them to make changes to the report, so they could mess it up if they don't know what they're doing...and I'm assuming most of them will not be experienced with FastReport.
.
I know MVD has some Toolbar settings for RTF forms but I can't seem to locate anything like that for FastReport.
.
Thanks
Frank

Re: FastReport Edit Page

put something like this on your Begin End. of the Script

BEGIN
Form1.frxReport.PreviewOptions.Buttons := pbPrint+pbZoom+pbFind+pbOutline+pbPageSetup+pbTools+pbNavigator+pbExportQuick;
END.

Form1 being your main form

brian

3 (edited by papafrankc 2022-05-15 23:50:42)

Re: FastReport Edit Page

Brian,
Thanks for the suggestion.  I've been trying to implement the change but am having problems.
.
Here's what I have tried so far:
Your code - Form1.frxReport.PreviewOptions.Buttons := pbPrint+pbZoom...
My code - frmEquip.btnPrintInstalled. ??? := pbPrint+pbZoom.....
- I changed Form1 to frmEquip
- I don't see any  .frxReport   so I picked a button that seemed to be related to the report.
- Then after that I can't see anything that seems to be related?
.
Any suggestions. (this is definitely challenging my competence level, but with expert guidance by folks like yourself, that's how I have learned so many things) smile
.
Question - I've never seen anything put between the BEGIN and END at the end of the scriipt before.  Is this where you might put something that you want executed all the time?  Sort of like declaring variables at the top of the script?
.
Thanks
Frank

Re: FastReport Edit Page

Hi Frank, Brian,
A simple option might be to send the output to PDF (rather than Preview) where the report can still be viewed but it only gets printed if the user  selects to do so.
Admittedly this could end up leaving small files in a /temp folder somewhere.
Derek.

Post's attachments

Attachment icon frank pdf.jpg 79.44 kb, 29 downloads since 2022-05-16 

Re: FastReport Edit Page

That's great derek. There you have option now frank.
For your reference or future works, here's how you do it. You can choose what button/s you want to hide by simple removing it from the equation. I used it on some of my project with trial version. I excluded their print and exprot pdf so that they can preview the report but can't do anything with it except having print screen of it.

Post's attachments

Attachment icon FrankReport.zip 545.76 kb, 89 downloads since 2022-05-16 

brian

Re: FastReport Edit Page

Brian, Derek,
.
It looks like the PDF option might be the way to go.  It'll be the easiest to implement.  With the PDF file, the user can View the report, Print the report, and save the report. I can't think about anything else they might want to do?
.
Brian,
I tried to implement your fix so I could see and learn something different.
However, MVD doesn't like frxReport It says it is an undeclared identifier.
Is it the name of a button or maybe a field?
I didn't see it anywhere in your example application.
.
I'm wondering if it should maybe be the name of the Report File?
.
Thanks
Frank

7 (edited by sparrow 2022-05-16 10:32:52)

Re: FastReport Edit Page

Hi all,

or

begin
Form1.frxReport.PreviewOptions.AllowEdit := False;
end.

just disables editing in FastReport. Inactive icon.


Frank,

Look closely. Instead of Form1, you need to enter the NAME of your MAIN FORM (displayed first on the screen at startup).
Other form names will result in this error.

Re: FastReport Edit Page

Sparrow,
Your solution works perfectly. It does disable just the Edit Page icon in ALL of the Fast Reports.
.
Derek is also correct as PDF does work and is an option.  However I do slightly prefer the format of the PREVIEW option in FastReport.
.
Brian is also correct, I just didn't understand that the code needed to reference the FORM1 of the application.  I was trying to use the form that was calling the report.  My bad.
.
Thank you all for helping with my ongoing education.
Frank

Re: FastReport Edit Page

Each solution has its own advantages and disadvantages.
The solution that I proposed is not entirely complete.
It disables editing, but it remains possible to export to .rtf format with the ability to change in Word))).


I think the best decisions are Derek and Brian.
Brian's solution needs to be supplemented by removing the export button.


The choice is yours.

Re: FastReport Edit Page

Sparrow,
My original concern was that, by using EDIT PAGE,  a user would have the ability to change the format of the original report.  I don't think they would do that deliberately but maybe they would do it by accident.  Sometimes folks just get curious and click on buttons or icons to see what they do.  I've been know to try that myself sad
.
I did check out Exporting the file to RTF and PDF.  But to me that doesn't look like it would be a problem.  They will have a copy of the report and could edit it if they wanted, but they wouldn't be able to edit the original report file. 
.
My logic may have some flaws? but so far I think I'm good to go.  Please let me know if you think I should go in a different direction.
.
Thanks for your help
Frank

Re: FastReport Edit Page

Hi Frank,
Another option might be to set the xxxx.fr3 report in the Report folder to read-only.
The user could still edit the report (accidently or otherwise) but would not be able to save it.
Derek.