public void ApplyChanges(ReportParameterValues parameterValues) { var labelIndex = c1FlexGrid1.Cols.Fixed; var valueIndex = labelIndex + 1; parameterValues.Clear(); for (int i = 1; i < c1FlexGrid1.Rows.Count; i++) { var row = c1FlexGrid1.Rows[i]; if (row.IsNew) { continue; } var item = new ReportParameterValue(); if (row[labelIndex] != null) { item.Name = row[labelIndex].ToString(); } if (row[valueIndex] != null) { item.Value = (ScriptObjectValue)row[valueIndex].ToString(); } parameterValues.Add(item); } }
private void GetReportParameterValuesEnviroment(ReportParameterValues rpvs, out string scriptNamePrefix, out C1FlexReport anotherReport) { if (rpvs.Owner is SubreportField) { scriptNamePrefix = ((SubreportField)rpvs.Owner).Name + ""; anotherReport = ((SubreportField)rpvs.Owner).Subreport; } else if (rpvs.Owner is ReportLinkTargetBookmark) { scriptNamePrefix = "Hyperlink"; anotherReport = ((ReportLinkTargetBookmark)rpvs.Owner).Report; } else { System.Diagnostics.Debug.Assert(false); scriptNamePrefix = "Script"; anotherReport = null; } scriptNamePrefix += ".ParameterValues"; }
public void Init(FlexDesignerHostServices provider, ReportParameterValues parameterValues) { Debug.Assert(parameterValues != null); _provider = provider; C1FlexReport anotherReport; GetReportParameterValuesEnviroment(parameterValues, out _scriptNamePrefix, out anotherReport); _report = parameterValues.Report; _updating = true; _valueEditor = new ValueEditor(c1FlexGrid1); _valueEditor.Init(provider, _report.DataSourceName, ""); C1ThemeController.ApplyThemeToControlTree(_valueEditor, MainForm.TheMainForm.CachedTheme); _nameEditor = new NameEditor(c1FlexGrid1); _nameEditor.Init(provider, anotherReport); C1ThemeController.ApplyThemeToControlTree(_nameEditor, MainForm.TheMainForm.CachedTheme); var labelIndex = c1FlexGrid1.Cols.Fixed; var valueIndex = labelIndex + 1; foreach (var item in parameterValues) { var row = c1FlexGrid1.Rows.Add(); row[labelIndex] = ScriptValueHelper.ToString(item.Name); row[valueIndex] = ScriptValueHelper.ToString(item.Value); } c1FlexGrid1.Col = labelIndex; if (parameterValues.Count > 0) { c1FlexGrid1.Row = c1FlexGrid1.Rows.Fixed; } UpdateButtonsSatus(); _updating = false; }