public static List <ReportParameterInfo> getReportParameters(ReportViewerModel model)
        {
            var contentData       = new ReportExportResult();
            var definedParameters = ReportServiceHelpers.GetReportParameters(model, true);

            contentData.SetParameters(definedParameters, model.Parameters);
            return(contentData.Parameters);
        }
        public static string ParametersToHtmlString(System.Collections.Generic.List <ReportParameterInfo> parameters, ReportViewerModel model)
        {
            StringBuilder sb = new StringBuilder();

            if (parameters == null)
            {
                var contentData       = new ReportExportResult();
                var definedParameters = ReportServiceHelpers.GetReportParameters(model, true);
                contentData.SetParameters(definedParameters, model.Parameters);
                parameters = contentData.Parameters;
            }

            //Parameters start
            foreach (var reportParameter in parameters)
            {
                sb.AppendLine("					<div class='Parameter col-md-6 col-sm-12'>");
                if (reportParameter.PromptUser || model.ShowHiddenParameters)
                {
                    sb.AppendLine($"						<div class='col-sm-4'><label for='{reportParameter.Name}'>{reportParameter.Prompt}</label></div>");

                    sb.AppendLine("							<div class='col-sm-8'>");
                    if (reportParameter.ValidValues != null && reportParameter.ValidValues.Any())
                    {
                        sb.AppendLine($"						<select id='{reportParameter.Name}' name='{reportParameter.Name}' class='form-control' {(reportParameter.MultiValue == true ? "multiple='multiple'" : "")}>");
                        foreach (var value in reportParameter.ValidValues)
                        {
                            sb.AppendLine($"							<option value='{value.Value}' {(reportParameter.SelectedValues.Contains(value.Value) ? "selected='selected'" : "")}>{value.Label}</option>");
                        }
                        sb.AppendLine($"						</select>");
                    }
                    else
                    {
                        var selectedValue = reportParameter.SelectedValues.FirstOrDefault();

                        if (reportParameter.Type == ReportService.ParameterTypeEnum.Boolean)
                        {
                            sb.AppendLine($"						<input type='checkbox' id='{reportParameter.Name}' name='{reportParameter.Name}' class='form-control' {(selectedValue.ToBoolean() ? "checked='checked'" : "")} />");
                        }
                        else if (reportParameter.Type == ReportService.ParameterTypeEnum.DateTime)
                        {
                            sb.AppendLine($"						<input type='datetime' id='{reportParameter.Name}' name='{reportParameter.Name}' class='form-control' value='{selectedValue}' />");
                        }
                        else
                        {
                            sb.AppendLine($"						<input type='text' id='{reportParameter.Name}' name='{reportParameter.Name}' class='form-control' value='{selectedValue}' />");
                        }
                    }

                    sb.AppendLine("							</div>");
                }
                else
                {
                    if (reportParameter.SelectedValues != null && reportParameter.SelectedValues.Any())
                    {
                        var values = reportParameter.SelectedValues.Where(x => x != null).Select(x => x).ToArray();
                        sb.AppendLine($"			<input type='hidden' id='{reportParameter.Name}' name='{reportParameter.Name}' value='{String.Join(",", values)}' />");
                    }
                }

                sb.AppendLine($"			<input type='hidden' id='ReportViewerEnablePaging' name='ReportViewerEnablePaging' value='{model.EnablePaging}' />");

                sb.AppendLine("					</div>");
            }

            return(sb.ToString());
        }