Toolbar.Backend.razor.cs 626 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Components;
  6. using Microsoft.JSInterop;
  7. namespace FastReport.Web.Blazor.Components
  8. {
  9. public partial class Toolbar
  10. {
  11. [Inject]
  12. protected IJSRuntime JSRuntime { get; set; }
  13. private async Task PrintReportAsync(PrintTypes type)
  14. {
  15. var printFormat = type is PrintTypes.HTML ? "html" : "pdf";
  16. var url = WebReport.template_print_url(printFormat);
  17. await JSRuntime.InvokeVoidAsync("window.open", url, "_blank");
  18. }
  19. }
  20. }