Hi,
I'm having an issue with a report. I design it first in the editor, and a chart legend is defined with the syntax of a variable (something like {ChartTitle}).
Then by code, I load the template, and set the variable by code : this.report.Dictionary.Variables.Add("MyCategory", "ChartTitle", val);
Then I have 2 cases :
First : I call "this.report.Design()", in which case my variable is properly resolved in the designer, and then if I call render + Save, then my value is in the report
Second : I don't call "this.report.Design()", in which case my variable isn't resolved, and the Legend in the mdc file is still "{ChartTitle}".
What should I do to have the proper behaviour without calling the "Design" method ?
Variable not resolved
Re: Variable not resolved
Hello,
In this vase, you can use the following code to set the Title before render report:
Thank you.
In this vase, you can use the following code to set the Title before render report:
Code: Select all
var chart = report.GetComponentByName("Chart1") as StiChart;
chart.Title = new Stimulsoft.Report.Chart.StiChartTitle(new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold), "YOUR VALUE", new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.FromArgb(255, 140, 140, 140)), true, System.Drawing.StringAlignment.Center, Stimulsoft.Report.Chart.StiChartTitleDock.Top, 2, true, true);