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 11:57AM
    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 11:57AM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.