You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,24 @@ ReportViewer.NET is currently designed to target .NET 8.
12
12
13
13
1. Include the provided CSS in `assets/reportviewer.net.css` in your project.
14
14
2. Include the provided JS in `assets/reportviewer.net.js` in your project.
15
-
3. Read the remainder of this section to learn how to use ReportViewer.NET in your project.
15
+
3. Create the HTML placeholder element and load the JS in your HTML file by adding the following:
16
+
17
+
```
18
+
<div class="report-viewer">
19
+
20
+
</div>
21
+
22
+
<script type="text/javascript">
23
+
var reportViewer = new ReportViewer('/api/Reports', 'My RDL file');
24
+
25
+
reportViewer.postReportParameters();
26
+
</script>
27
+
28
+
```
29
+
30
+
The `ReportViewer` function accepts two parameters: `apiPath` and `rdlName`, where `apiPath` references the name of your API path minus the endpoint itself. ReportViewer.NET expects two endpoints to be available on the given path: `GenerateParameters` and `GenerateReport`.
31
+
32
+
4. Read the remainder of this section to learn how to use ReportViewer.NET in your project.
16
33
17
34
ReportViewer.NET exposes the Interface `IReportHandler` and Class `ReportHandler` which are intended to be injected to your ASP.NET Controller via Dependency Injection. Please ensure that you register ReportViewer.NET using a Scoped/Transient lifetime - this library should not be registered with a Singleton lifetime.
18
35
@@ -60,7 +77,7 @@ public class HomeController : Controller, IReportViewerController
60
77
// Default endpoints omitted for brevity.
61
78
62
79
[HttpPost]
63
-
public async Task<IActionResult> ParameterViewer([FromQuery] string rdl, [FromBody] ReportParameters userProvidedParameters)
80
+
public async Task<IActionResult> GenerateParameters([FromQuery] string rdl, [FromBody] ReportParameters userProvidedParameters)
64
81
{
65
82
// The 'LoadReport' method parses the report RDL's XML and initialises the C# object hierarchy.
0 commit comments