Preflight Preparation
To use Blazor components in FastReport.Web
, you need to add a reference in your project file (csproj)
PackageReference
specifying the id of this package and the FastReport.Core
package (versions may differ):
<ItemGroup>
<PackageReference Include="FastReport.Core" Version="2021.3.0-demo"/>
<PackageReference Include="FastReport.Web" Version="2021.3.0-demo"/>
</ItemGroup>
Then, to simplify naming, we recommend adding the following namespaces to your project's imports (_Imports.razor
file):
@using FastReport.Web
@using FastReport.Web.Blazor.Components
@using FastReport.Web.Blazor.Components.Internal
In fact, just adding FastReport.Web.Blazor.Components
may be enough, however, for some cases, you may need other namespaces as well.
Also, some components are likely to move within these namespaces during the beta version.
In the configurator of your web application, you need to call the UseFastReport
method with an optional
lambda expression for setting FastReportOptions
.
Also, for some built-in common styles and SVG images of icons in Toolbar and Tab to work,
you need to use the UseStaticFiles
call (if you are not going to use Toolbar and Tabs, the UseStaticFiles
call to use this package is optional):
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// ...
app.UseStaticFiles();
// ...
app.UseFastReport();
// ...
}