This sample demonstrates the use of custom resources service for GrapeCity ActiveReports Web Designer with an ASP.NET Core backend.
To use custom store for a designer follow these steps:
- Implement
IResourcesServiceinterface. Also you should implementIDisposableinterface if you use any unmanaged resources. - Implement
ResourceLocatorfor your store. It is required for the correct getting report resources (datasets, themes, images, etc). - In
GetReportmethod redefine report site using implemented resourse locator. SeeCustomStoreReports.csfor more details. - In
Startupclass:- Register your implemented
IResourcesServiceservice. - Call
UseCustomStoremethod for viewer (app.UseReporting) withGetReportmethod as argument. - Call
UseCustomStoremethod for designer (app.UseDesigner) withIResourcesServiceimplementation as argument.
- Register your implemented
This case contains two different implementations based on the LiteDB and CosmosDB as an example.
LiteDB implementation is used by default. To try CosmosDB implementation, please, follow this guide.
This sample requires:
- Visual Studio 2022 17.0 or newer
- .NET 6.0 SDK
- .NET Core Hosting Bundle (for deployment to IIS)
- Start Microsoft Visual Studio and select File → Open → Project/Solution.
- Go to the sample folder. Double-click the Visual Studio Solution (.sln) file.
- Right-click the solution in Solution Explorer and select Restore NuGet Packages.
- Press Ctrl+Shift+B, or select Build → Build Solution.
To debug the sample and then run it, press F5 or select Debug → Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug → Start Without Debugging.