Reputation: 21
I am currently testing blazor server side framework. I would like to use FastReport in a Razor Component page. My problem is that the FastReport RenderSync/Async Method returns me an HtmlString. I tried to cast it to a MarkupString an insert it into the html code, but the report doesnt get displayed. I think the problem is that blazor uses a "shadowDOM" and changes the HTML markup. Sometimes i see the report rendered for a second. Is there any possibility to prevent blazor from touching this code? Or is there an other solution like "loading a razor page" per and inject it per javascript.
Thanks for help
@page "/"
@inherits IndexBase
<div class="container">
@((MarkupString)report.RenderSync().Value)
</div>
public IndexBase() {
_reportFn = @"C:\tmp\Report\report.frx";
report = new WebReport();
report.Report.Load(_reportFn);
var dataSet = new DataSet();
dataSet.ReadXml(@"C:\tmp\Report\nwind.xml");
report.Report.RegisterData(dataSet, "NorthWind");
}
Upvotes: 0
Views: 1430
Reputation: 21
I thought in the wrong direction. The problem was not the shadow dom and manipulation of the blazor framework. The problem was that the javascript from the injected HtmlString was not executed. I now extract the script tag from the HtmlString and inject it with javascript. ;-)
Upvotes: 2