Change Report Object Value

StarkStark Syria
edited October 2008 in FastReport .NET
Hi , Have a good day all ...

I was playing around fast report .net with C# , and it's really amazing for me and nearly perfect ... ,, thank you FR team for this charming piece

Ok , then ,,,,

I wonder if there is an easy way , to change an Object value within Fast report from my C# Application ... at run time


for example

I have an TextObject within Fast Report ...with Name "MyText" , and it's not connected to any data source

I want to find an easy way .... to change "MyText".Value .... with out using any data source

as far as I got ....
((FastReport.TextObject)report1.AllObjects[2]).Value = "myvalue";
[img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> but nothing help .....[/img][img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> thank in advance .....[/img]

Comments

  • edited 4:36PM
    Hello,

    Try the following:
    TextObject myText = report1.FindObject("MyText") as TextObject;
    myText.Text = "myvalue";
    
  • StarkStark Syria
    edited 4:36PM
    Thank you , so much ... it's worked !! >
    FastReport.TextObject myText = (FastReport.TextObject)report1.FindObject("MyText");
    myText.Text = "myvalue";
    


  • WOWWOW
    edited 4:36PM
    i'll do it like this
            Dim Myparameter As New FastReport.Data.Parameter("p1")
            Myparameter.DataType = GetType(String)
            Myparameter.AsString = "value1"
            Report1.Dictionary.Parameters.Add(para)
    


    By the way
    1. the demo will throw an exception when i use "Edit Page" in Preview from or invoke "Design form".
    2. when i change Orientation.Portrait to Orientation.Landscape and "Apply to all pages" is not checked in Preview from, then. the CurrentPage may be not cover the data

    :lol:" border="0" alt="laugh.gif" /> i hope you can understand" alt="> i hope you can understand" />>
  • edited 4:36PM
    1) I've uploaded the fixed version.
    2) that's why you have to check the "Apply to all pages". I will rename its caption to make it more clear.

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.