-
Notifications
You must be signed in to change notification settings - Fork 1
/
Viewer.razor
42 lines (32 loc) · 1.2 KB
/
Viewer.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@page "/viewer"
@using DevExpress.Blazor.Reporting
@using DevExpress.XtraReports;
@using BlazorApp.Reports;
<link href="_content/DevExpress.Blazor.Themes/blazing-berry.bs5.css" rel="stylesheet" />
<link rel="stylesheet" href="_content/DevExpress.Blazor.Reporting.Viewer/css/dx-blazor-reporting-components.bs5.css">
<input @bind="paramValue" />
<button @onclick="SubmitParameter">Submit</button>
<DxReportViewer @ref="reportViewer" Report="@Report"></DxReportViewer>
@code {
DxReportViewer reportViewer;
string paramName = "strParam";
string paramValue = "0";
IReport Report;
protected override void OnAfterRender(bool firstRender)
{
if (firstRender){
var report = new XtraReport1();
report.Parameters[paramName].Visible = false;
Report = report;
}
base.OnAfterRender(firstRender);
}
void SubmitParameter(){
var report = new XtraReport1();
report.Parameters[paramName].Value = paramValue;
report.Parameters[paramName].Visible = false;
report.CreateDocument();
reportViewer.TabPanelModel.Tabs[0].Visible = false;
Report = report;
}
}