MHTExport.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using FastReport.Utils;
  2. using FastReport.Export.Html;
  3. namespace FastReport.Export.Mht
  4. {
  5. /// <summary>
  6. /// Represents the MHT export filter.
  7. /// </summary>
  8. public partial class MHTExport : ExportBase
  9. {
  10. #region Private fields
  11. private HTMLExport htmlExport;
  12. private MyRes res;
  13. #endregion
  14. #region Public properties
  15. /// <summary>
  16. /// Enable or disable the pictures in MHT export
  17. /// </summary>
  18. public bool Pictures
  19. {
  20. get { return htmlExport.Pictures; }
  21. set { htmlExport.Pictures = value; }
  22. }
  23. /// <summary>
  24. /// Gets or sets the Wysiwyg quality of export
  25. /// </summary>
  26. public bool Wysiwyg
  27. {
  28. get { return htmlExport.Wysiwyg; }
  29. set { htmlExport.Wysiwyg = value; }
  30. }
  31. /// <summary>
  32. /// Gets or sets the image format.
  33. /// </summary>
  34. public FastReport.Export.Html.ImageFormat ImageFormat
  35. {
  36. get { return htmlExport.ImageFormat; }
  37. set { htmlExport.ImageFormat = value; }
  38. }
  39. #endregion
  40. #region Protected methods
  41. /// <inheritdoc/>
  42. protected override string GetFileFilter()
  43. {
  44. return new MyRes("FileFilters").Get("MhtFile");
  45. }
  46. /// <inheritdoc/>
  47. protected override void Start()
  48. {
  49. base.Start();
  50. htmlExport.Format = HTMLExportFormat.MessageHTML;
  51. htmlExport.PageNumbers = PageNumbers;
  52. htmlExport.SinglePage = true;
  53. htmlExport.Navigator = false;
  54. htmlExport.SubFolder = false;
  55. Report.Export(htmlExport, Stream);
  56. }
  57. /// <inheritdoc/>
  58. protected override void Finish()
  59. {
  60. }
  61. #endregion
  62. /// <summary>
  63. /// Initializes a new instance of the <see cref="MHTExport"/> class.
  64. /// </summary>
  65. public MHTExport()
  66. {
  67. htmlExport = new HTMLExport();
  68. res = new MyRes("Export,Mht");
  69. }
  70. }
  71. }