How to access properties from parameter?

hi, I need to access properties form registered parameter in TextObjects.

First I registered parameter like this:
report.SetParameterValue("MySelectedObject", MyObject);
where MyObject has two properties Name and Description.

In Referenced assemblies I added assembly with MyObject definition.
I added TextObject and in BeforePrint Event
MyObject param = Report.GetParameterValue("MySelectedObject") as MyObject;
Text1.Text = param.Name;
Great that works,
but when I add TextObject and in text property [MySelectedObject.Name] I get this Error
Text2: error CS0103: Name "MySelectedObject" does not exist in the current content.

What I'm doing wrong?

Best regards.
--
mn

Comments

  • edited 1:10AM
    Hello,

    This way it should work (type this in the Text object):

    [[MySelectedObject].Name]

    [MySelectedObject] actually returns MyObject instance, the explanation is here: http://fast-report.com/documentation/UserM...expressions.htm.
  • edited 1:10AM
    hi,

    [[MySelectedObject].Name] Works!!!

    [MySelectedObject.Name]
    Works if I do something like this:
    report.SetParameterValue("MySelectedObject", MyObject);
    report.SetParameterValue("MySelectedObject.Name", MyObject.Name);

    I miss understood the spec. Thanks for explanation.

    --
    mn

Leave a Comment