Hello,
I am having trouble with GetDataListFromDataColumn() method. It´s returning values only if it´s called in Events. Otherwise it is returning null. Is there a way to use this method without an Event?
As attachments there is a test report and XML file containing data.
I am using GetDataListFromDataColumn() method in public Report().
Thank you, Filip
method GetDataListFromDataColumn() not returning values
method GetDataListFromDataColumn() not returning values
- Attachments
-
- Report_test.mrt
- (14.01 KiB) Downloaded 178 times
-
- Novy1.xml
- (4.16 KiB) Downloaded 189 times
-
- Posts: 7341
- Joined: Tue Mar 20, 2018 5:34 am
Re: method GetDataListFromDataColumn() not returning values
Hello,
Sorry, maybe we did not exactly understand your issue. Could you explain your task in more detail?
Thank you.
Sorry, maybe we did not exactly understand your issue. Could you explain your task in more detail?
Thank you.
Re: method GetDataListFromDataColumn() not returning values
Hello,
sure. I have a public static List <object> called "Rep", which I want to populate with GetDataListFromDataColumn() method.
Now, I have this method, which should populate List "Rep" with data from "Data.ColData1".
When I try to acces Rep[0] later in code it is null. But If I populate List "Rep" in GetValue Event, it´s populated correctly:
I need to populate List "Rep" globaly, so I could access it within text components. For example I would like to use:
Thank you, Filip
sure. I have a public static List <object> called "Rep", which I want to populate with GetDataListFromDataColumn() method.
Now, I have this method, which should populate List "Rep" with data from "Data.ColData1".
Code: Select all
public Report()
{
this.AddData();
this.InitializeComponent();
Rep = Stimulsoft.Report.Dictionary.StiDataColumn.GetDataListFromDataColumn(this.Dictionary, "Data.ColData1");
}
Code: Select all
public void Text1__GetValue(object sender, Stimulsoft.Report.Events.StiGetValueEventArgs e)
{
Rep = Stimulsoft.Report.Dictionary.StiDataColumn.GetDataListFromDataColumn(this.Dictionary, "Data.ColData1");
e.Value = ToString(Rep[0]);
}
Code: Select all
Text1.Width = double.Parse(Rep[0].ToString())
-
- Posts: 7341
- Joined: Tue Mar 20, 2018 5:34 am
Re: method GetDataListFromDataColumn() not returning values
Hello,
The data is connected only during the rendering of the report, before and after the data is disabled. If you need to get the data outside the rendering - the easiest way is to connect the dictionary:
Dictionary.Connect();
Rep = .....GetDataListFromDataColumn(this.Dictionary, "Data.ColData1");
Dictionary.Disconnect();
Thank you.
The data is connected only during the rendering of the report, before and after the data is disabled. If you need to get the data outside the rendering - the easiest way is to connect the dictionary:
Dictionary.Connect();
Rep = .....GetDataListFromDataColumn(this.Dictionary, "Data.ColData1");
Dictionary.Disconnect();
Thank you.