Programatically setting chart data with Arguments or ArgumentsString not working

Stimulsoft Reports.NET discussion
Post Reply
aaronrc
Posts: 23
Joined: Thu Apr 05, 2012 2:41 am

Programatically setting chart data with Arguments or ArgumentsString not working

Post by aaronrc »

I'm programatically adding some charts to my report as per http://stimulsoft.helpserve.com/index.p ... d=49&nav=0. It works fine if I use a data source as in that example but if I try using the Arguments/Values properties or the ArgumentsString/ValuesString properties no data appears on the chart. Setting the ArgumentsString/ValuesString through the designer works. Example of failing report attached.
Attachments
1777.CreateChart.zip
(41.77 KiB) Downloaded 257 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Programatically setting chart data with Arguments or ArgumentsString not working

Post by HighAley »

Hello.
aaronrc wrote:I'm programatically adding some charts to my report as per http://stimulsoft.helpserve.com/index.p ... d=49&nav=0. It works fine if I use a data source as in that example but if I try using the Arguments/Values properties or the ArgumentsString/ValuesString properties no data appears on the chart. Setting the ArgumentsString/ValuesString through the designer works. Example of failing report attached.
To set Argument/Value properties you should use next code:

Code: Select all

item.Argument = new Stimulsoft.Report.Components.StiArgumentExpression("{Products.Categories.CategoryName}");
item.Value = new Stimulsoft.Report.Components.StiExpression("{2*Products.UnitPrice}");
And to set 'List of Values' and 'List of Arguments' properties you should use next code:

Code: Select all

item.ListOfArguments = new Stimulsoft.Report.Components.StiListOfArgumentsExpression("USA;England;Russia");
item.ListOfValues = new Stimulsoft.Report.Components.StiListOfValuesExpression("10;20;15");
Thank you.
Post Reply