You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

1 month ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace ReportLibrary
  11. {
  12. public partial class TemplateDesignForm : Form
  13. {
  14. private FastReport.Report _report;
  15. private string _filePath;
  16. public FastReport.Report Report
  17. {
  18. get { return this.designerControl1.Report; }
  19. set { this.designerControl1.Report = value; }
  20. }
  21. public void FillReport(FastReport.Report report)
  22. {
  23. Report = report;
  24. designerControl1.RefreshLayout();
  25. }
  26. public TemplateDesignForm(FastReport.Report report, string filepath)
  27. {
  28. InitializeComponent();
  29. _report = report;
  30. _filePath = filepath;
  31. }
  32. private void TemplateDesignForm_Load(object sender, EventArgs e)
  33. {
  34. WindowState = FormWindowState.Maximized;
  35. Report = _report;
  36. designerControl1.RefreshLayout();
  37. }
  38. private void TemplateDesignForm_FormClosed(object sender, FormClosedEventArgs e)
  39. {
  40. Report.Save(_filePath);
  41. this.Dispose(true);//表示真要释放资源
  42. }
  43. }
  44. }