Handle Dialog Forms.frx 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Report ScriptLanguage="CSharp" ReportInfo.Description="Demonstrates how to handle the visibility of several dialog forms.&#13;&#10;&#13;&#10;The report can contain several dialog forms. When you run the report, it will show the first dialog; if you click OK you will see the next dialog and so on. When you finish with all the dialogs, you will see the report. If you click Cancel or close any dialog by the X button, the report execution will be terminated.&#13;&#10;&#13;&#10;You can skip the dialog if you set its Visible property to false." ReportInfo.Created="05/29/2008 20:29:50" ReportInfo.Modified="03/30/2023 02:38:02" ReportInfo.CreatorVersion="1.0.0.0">
  3. <ScriptText>using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Windows.Forms;
  8. using System.Drawing;
  9. using System.Data;
  10. using FastReport;
  11. using FastReport.Data;
  12. using FastReport.Dialog;
  13. using FastReport.Barcode;
  14. using FastReport.Table;
  15. using FastReport.Utils;
  16. namespace FastReport
  17. {
  18. public class ReportScript
  19. {
  20. private void Form1_FormClosed(object sender, FormClosedEventArgs e)
  21. {
  22. Form2.Visible = CheckBox1.Checked;
  23. }
  24. }
  25. }
  26. </ScriptText>
  27. <Dictionary/>
  28. <DialogPage Name="Form1" AcceptButton="btnOk" CancelButton="btnCancel" AutoScaleDimensions="192, 192" Font="Segoe UI, 9pt" Text="Dialog 1" FormClosedEvent="Form1_FormClosed" ClientSize="634, 282">
  29. <ButtonControl Name="btnCancel" Left="462" Top="214" Width="150" Height="46" Anchor="Bottom, Right" Font="Segoe UI, 9pt" TabIndex="0" Text="Cancel" DialogResult="Cancel"/>
  30. <ButtonControl Name="btnOk" Left="300" Top="214" Width="150" Height="46" Anchor="Bottom, Right" Font="Segoe UI, 9pt" TabIndex="1" Text="OK" DialogResult="OK"/>
  31. <CheckBoxControl Name="CheckBox1" Left="24" Top="120" Width="528" Font="Segoe UI, 9pt" TabIndex="2" Text="After closing this dialog, show the next dialog."/>
  32. <LabelControl Name="Label1" Left="24" Top="24" Width="556" Height="64" Font="Segoe UI, 9pt" TabIndex="3" Text="This report has two dialog forms.&#13;&#10;Check the checkbox to view the second dialog form."/>
  33. </DialogPage>
  34. <DialogPage Name="Form2" AcceptButton="btnOk1" CancelButton="btnCancel1" AutoScaleDimensions="192, 192" Font="Segoe UI, 9pt" Text="Dialog 2" ClientSize="536, 250">
  35. <ButtonControl Name="btnCancel1" Left="362" Top="182" Width="150" Height="46" Anchor="Bottom, Right" Font="Segoe UI, 9pt" TabIndex="0" Text="Cancel" DialogResult="Cancel"/>
  36. <ButtonControl Name="btnOk1" Left="200" Top="182" Width="150" Height="46" Anchor="Bottom, Right" Font="Segoe UI, 9pt" TabIndex="1" Text="OK" DialogResult="OK"/>
  37. <LabelControl Name="li" Left="24" Top="24" Width="371" Height="64" Font="Segoe UI, 9pt" TabIndex="3" Text="This is the second dialog form.&#13;&#10;Click the OK button to view report."/>
  38. </DialogPage>
  39. <ReportPage Name="Page1" Watermark.Font="Arial, 60pt">
  40. <DataBand Name="Data1" Width="718.2" Height="75.6">
  41. <TextObject Name="Text1" Left="9.45" Top="13.45" Width="387.45" Height="56.7" Text="CheckBox checked: [CheckBox1.Checked]&#13;&#10;Second Form visibility: [Form2.Visible]" Font="Segoe UI, 14pt"/>
  42. </DataBand>
  43. <PageFooterBand Name="PageFooter1" Top="77.6" Width="718.2" Height="26.9" Fill.Color="WhiteSmoke">
  44. <TextObject Name="Text12" Left="9.45" Top="-1.45" Width="217.35" Height="28.35" Cursor="Hand" Hyperlink.Value="https://www.fast-report.com/en/product/fast-report-net/" Text="Generated by FastReport" VertAlign="Center" Font="Segoe UI, 9pt, style=Underline" TextFill.Color="Blue"/>
  45. </PageFooterBand>
  46. </ReportPage>
  47. </Report>