|
Please refer the below code in your application for passing parameter from client side.
1. Integrate Report parameters in BoldReportViewer class.
2. Open boldreports-interop.js file and the parameter method.
3. In Report viewer Razor page assign the parameter value.
|
|
The problem is that before using the boldreports everything worked but now, if I place the bold line there, the calendar is no more showed and the report works instead if I place that bold line at the end of all the js files, the calendar works again and the report generates an error.
I don't know what this script does "https://cdn.syncfusion.com/ej2/dist/ej2.min.js" but it's clear that the boldreports script are not well integrated with other script.
How can I solve this problem ?
Thanks
|
You need to use the compatibility styles and an order of scripts when using Bold Reports along with ej2 components. We suggest you to refer the below scripts in you application,
For Style, you need to refer the compatibility styles of EJ2 from Bold Reports and Bold Reports styles should be referred before EJ2 styles.
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/styles/compatibility/material.css" rel="stylesheet" />
<link rel='nofollow' href="https://cdn.boldreports.com/2.4.10/content/bold.widgets.core.compatibility.min.css" rel="stylesheet" />
<link rel='nofollow' href="https://cdn.boldreports.com/2.4.10/content/material/bold.theme.compatibility.min.css" rel="stylesheet" /> You should refer EJ2 scripts before Bold Reports scripts as follows.
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BoldReports ReportViewer and EJ2 controls</title>
@* Syncfusion Essential JS 2 Styles *@
<link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/ej2/styles/compatibility/material.css" />
@* BoldReports Styles *@
<link rel='nofollow' href="https://cdn.boldreports.com/2.4.10/content/bold.widgets.core.compatibility.min.css" rel="stylesheet" />
<link rel='nofollow' href="https://cdn.boldreports.com/2.4.10/content/material/bold.theme.compatibility.min.css" rel="stylesheet" />
@*Default scripts*@
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" type="text/javascript"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
@* Syncfusion Essential JS 2 Scripts *@
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js"></script>
@* BoldReports Scripts *@
<script src="https://cdn.boldreports.com/2.4.10/scripts/common/bold.reports.common.min.js"></script>
<script src="https://cdn.boldreports.com/2.4.10/scripts/common/bold.reports.widgets.min.js"></script>
<!--Used to render the chart item. Add this script only if your report contains the chart report item.-->
<script src="https://cdn.boldreports.com/2.4.10/scripts/data-visualization/ej.chart.min.js"></script>
<!-- Report Viewer component script-->
<script src="https://cdn.boldreports.com/2.4.10/scripts/bold.report-viewer.min.js"></script>
</head> If you have already referred the scripts as like in above then could you please share with us the snap of the issue as it will be helpful for us to check and provide the solution.
| |
|
And there's also another most important problem... I'm using RDLC and not RDL so I need to set reportOption.ReportModel.DataSource.
If I use your project, my DataSourrce is a parametrized query to the dB.
How can I pass my parameters from Reporting.razor to the public void OnInitReportOptions(ReportViewerOptions reportOption) where I set the DataSource ?
Surprisingly inside reportOption the reportOption.ReportModel.Parameters property is null.
|
Please find the below code example for filtering the data for RDLC in server side using parameters.
Also we have prepared a sample as per your requirement which can be found from below download link,
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ReportViewerBlazor946760287.zip
|
|
<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
@*Syncfusion Essential JS 2 Scripts*@
<script src="https://cdn.syncfusion.com/blazor/18.3.40/syncfusion-blazor.min.js"></script>
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
@*BoldReports Scripts*@
<script src="https://cdn.boldreports.com/2.3.39/scripts/common/bold.reports.common.min.js"></script>
<script src="https://cdn.boldreports.com/2.3.39/scripts/common/bold.reports.widgets.min.js"></script>
@*Used to render the chart item. Add this script only if your report contains the chart report item.*@
<script src="https://cdn.boldreports.com/2.3.39/scripts/data-visualization/ej.chart.min.js"></script>
|
|
<link rel="stylesheet" rel='nofollow' href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
@* Syncfusion Essential JS 2 Styles *@
<link rel="stylesheet" rel='nofollow' href="https://cdn.syncfusion.com/ej2/styles/compatibility/material.css" />
@* BoldReports Styles *@
<link rel='nofollow' href="https://cdn.boldreports.com/2.3.39/content/bold.widgets.core.material.compatibility.min.css" rel="stylesheet" />
<link rel='nofollow' href="https://cdn.boldreports.com/2.3.39/content/material/bold.theme.compatibility.min.css" rel="stylesheet" />
<link rel='nofollow' href="css/site.css" rel="stylesheet" />
@*Dependent scripts*@
<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
@*Syncfusion Essential JS 2 Scripts*@
<script src="https://cdn.syncfusion.com/blazor/18.3.40/syncfusion-blazor.min.js"></script>
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>
@*BoldReports Scripts*@
<script src="https://cdn.boldreports.com/2.3.39/scripts/common/bold.reports.common.min.js"></script>
<script src="https://cdn.boldreports.com/2.3.39/scripts/common/bold.reports.widgets.min.js"></script>
@*Used to render the chart item. Add this script only if your report contains the chart report item.*@
<script src="https://cdn.boldreports.com/2.3.39/scripts/data-visualization/ej.chart.min.js"></script>
@*Report Viewer component script*@
<script src="https://cdn.boldreports.com/2.3.39/scripts/bold.report-viewer.min.js"></script>
@*Blazor interop file*@
<script src="~/scripts/boldreports-interop.js"></script>
<script src="~/scripts/maskedpicker.js"></script>
@*questo script serve solo per poter mostrare il datepicker con la maschera*@
</head> |
|
window.onMaskInitialized = function (date, mask) {
var maskInstance = document.getElementById(mask).ej2_instances[0];
var datepicker = new ejs.calendars.DatePicker({
created: function () {
this.inputWrapper.container.style.display = "none";
},
change: function (args) {
var instance = document.getElementById("mask").ej2_instances[0]
if (args.isInteracted) {
instance.value = getMaskValue(this.value);
instance.focusIn();
}
},
showClearButton: false,
open: function (args) {
args.popup.relateTo = document.getElementById(mask).ej2_instances[0].inputObj.container;
}
});
…
…
var datepicker = new ejs.calendars.DatePicker({
created: function () {
this.inputWrapper.container.style.display = "none";
},
change: function (args) {
var instance = document.getElementById("mask1").ej2_instances[0]
if (args.isInteracted) {
instance.value = getMaskValue(this.value);
instance.focusIn();
}
},
showClearButton: false,
open: function (args) {
args.popup.relateTo = document.getElementById(mask).ej2_instances[0].inputObj.container;
}
}); |
|
<button type="button" @onclick="RenderReport">Open Report Viewer</button>
<button type="button" @onclick="ViewReport">View Report</button> |
|
private string ParameterInput = "2";
….
….
public async void ViewReport()
{
JSRuntime.InvokeVoidAsync("viewReport", "reportViewerControl", ParameterInput);
} |
|
function viewReport(elementID, ParamValue) {
var reportObject = $("#" + elementID).data("boldReportViewer");
reportObject.setModel({
parameters: [{
name: 'ProductSubcategory',
labels: [ParamValue],
values: [ParamValue],
nullable: false
}],
});
}; |
Hi, how would I pass parameters to rdlc report for the ReportWriter instead of the viewer?
Thanks