Using Environment Settings Component with Preview and Designer Controls
Hi,
Development Tool: Visual Studio.NET 2015
I'm trying to show the Designer button in the preview control (I'm using ShowPrepared method to show my report, the report was prepared in WCF), I have my own win form with Preview Control. How to link the EnvironmentSettings Control with the Preview Control in order to manage it using the EnvironmentSettings.
With DesignerControl, I'm trying to handle the event of the save, same issue here, is how to link the EnvironmentSettings Control with the DesignerControl, which I have it in my own form.
best regards,
Youssef
Development Tool: Visual Studio.NET 2015
I'm trying to show the Designer button in the preview control (I'm using ShowPrepared method to show my report, the report was prepared in WCF), I have my own win form with Preview Control. How to link the EnvironmentSettings Control with the Preview Control in order to manage it using the EnvironmentSettings.
With DesignerControl, I'm trying to handle the event of the save, same issue here, is how to link the EnvironmentSettings Control with the DesignerControl, which I have it in my own form.
best regards,
Youssef
This discussion has been closed.
Comments
https://www.fast-report.com/en/forum/index....ic=8990&hl=
Hello!
Make sure that the PreviewButtons.Design flag is set in PreviewControl.Buttons (or Config.PreviewSettings.Buttons), and that the Report object itself along with its template is loaded into the PreviewControl (report.Preview = previewControl1;), rather than just the prepared pages (.fpx), since switching to the designer requires
Intercepting the save operation in DesignerControl: The CustomSaveDialog and CustomSaveReport events can be attached via EnvironmentSettings or directly via Config.DesignerSettings, or you can override the action of the specific cmdSave button on DesignerControl:
// Option 1: via EnvironmentSettings / Config.DesignerSettings environmentSettings1.CustomSaveDialog += (s, e) => { // For example, selecting a report key instead of the standard dialog e.FileName = “MyReportKey”; e.Cancel = false; }; environmentSettings1.CustomSaveReport += (s, e) => { using var ms = new MemoryStream(); e.Report.Save(ms); // Save ms.ToArray() to the database or desired storage }; // Option 2: Intercept the save command on a specific DesignerControl designerControl1.cmdSave.CustomAction += (s, e) => { designerControl1.Report.Save(“custom_path.frx”); designerControl1.Modified = false; };