Parameter Grouping Condition(Condition Group Change Runtime) - Dynamic Change group

Stimulsoft Reports.WPF discussion
Post Reply
Noe
Posts: 1
Joined: Tue Nov 08, 2011 9:48 am
Location: Santo domingo

Parameter Grouping Condition(Condition Group Change Runtime) - Dynamic Change group

Post by Noe »

hi, my name is noel, i had problem while make my report in my work, the problem was change the group dynamic or too in runtime.

Is possible that Stimulsoft have the option but i can't find this option and for me chose make this option.

Ok, the global idea is create Class the Get Value of property, because Stimulsoft get values of the object by method Call Get_Value(object sender, notremenber e)
and you must make a report and create the group at design time.

ok, and then, change then property was created in designer and put owner option. Ok.

First, this the class GetValue property. (no is my OK)

Part 1

using System;
using System.Collections.Generic;
using System.Linq;
public static class PropertyValueGet
{
public static object GetPropertyValue(this object source, string property)
{
if (source == null) throw new ArgumentNullException("source");

var sourceType = source.GetType();
var sourceProperties = sourceType.GetProperties();

var propertyValue = (from s in sourceProperties
where s.Name.Equals(property)
select s.GetValue(source, null)).FirstOrDefault();

//return propertyValue != null ? (T)propertyValue : default(T);
return propertyValue;
}
}

for example in GetValue of make this:

Part 2

GroupHeaderBand1__GetValue(object sender, Stimulsoft.Report.Events.StiValueEventArgs e){

e.Value = PropertyValueGet.GetPropertyValue(TablaProducto, ((StiGroupHeaderBand)sender).Condition.Value);

}


Ok now, marked change of then column condition of the group, but remenber in into Group have the TextBox or Label.

now in GetValue of the TextBox or label change too, in my case is Text15 but you can put name costumer. Ok

ok, this is my first post i wait be very utility, thank you for you time.

Part 3

public void Text15__GetValue(object sender, Stimulsoft.Report.Events.StiGetValueEventArgs e)
{
e.Value = ToString(sender,PropertyValueGet.GetPropertyValue(TablaProducto, GroupHeaderBand1.Condition.Value) , true);
}

for change group Dynamic only we need change this option when call the report, ok.


Part 4


Reports.Report rept = new Reports.Report();
rept.GroupHeaderBand1.Condition.Value = "Categoria"; // this the name of column you want group, ok
rept.Show();




Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Parameter Grouping Condition(Condition Group Change Runtime) - Dynamic Change group

Post by Alex K. »

Hello,

We have some ideas in this direction, but our team leader does not plan some work in this direction in nearest future.

Thank you.
Post Reply