Doesnt Chage Value

edited 8:05AM in FastReport .NET
Dear All,

Hi, I want to set a parameter to my field with name "txtBarcode" in the .frx document that I was created.

I load it as carefully, after that, call the SetParameterValue function and set a value like this:
rpt.SetParameterValue("txtBarcode","test123");
Then I call Show function but the design view doesnt have my change and show the default parameter...
My code is like this:

FastReport.Report rpt = new Report();
rpt.Load("Label.frx");
rpt.SetParameterValue("Barcode1",textBox1.Text);
rpt.Parameters[0].Value = "asd";
rpt.Show();

Thanks for our helps, [img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> Best Regards.[/img]

Comments

  • edited 8:05AM
    Hello,

    To print a parameter's value in the Text object, put the following text in it:
    [Barcode1]

    This code will set the parameter value and run a report:
    FastReport.Report rpt = new Report();
    rpt.Load("Label.frx");
    rpt.SetParameterValue("Barcode1",textBox1.Text);
    rpt.Show();
  • edited 8:05AM
    AlexTZ wrote: »
    Hello,

    To print a parameter's value in the Text object, put the following text in it:
    [Barcode1]

    This code will set the parameter value and run a report:
    FastReport.Report rpt = new Report();
    rpt.Load("Label.frx");
    rpt.SetParameterValue("Barcode1",textBox1.Text);
    rpt.Show();

    Thanks for your help, But it doesnt work too. [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> I create a text object (Name:"Barcode1", Text:"[Barcode1]") and my code: FastReport.Report rpt = new FastReport.Report(); rpt.Load("TestLabel.frx"); rpt.SetParameterValue("Barcode1", txtBarcode.Text); rpt.Show(); Thanks for following. Best Regards,[/img]
  • edited 8:05AM
    This way it should work:

    a text object (Name:"Text1", Text:"[Barcode1]")

    a code to set the param value:
    FastReport.Report rpt = new Report();
    rpt.Load("Label.frx");
    rpt.SetParameterValue("Barcode1",textBox1.Text);
    rpt.Show();

    or, another way to change the text object directly:

    FastReport.Report rpt = new Report();
    rpt.Load("Label.frx");
    (rpt.FindObject("Text1") as TextObject).Text = textBox1.Text;
    rpt.Show();

    Also read about report parameters here:
    http://www.fast-report.com/documentation/U...tparameters.htm
  • edited 8:05AM
    AlexTZ wrote: »
    This way it should work:

    a text object (Name:"Text1", Text:"[Barcode1]")

    a code to set the param value:
    FastReport.Report rpt = new Report();
    rpt.Load("Label.frx");
    rpt.SetParameterValue("Barcode1",textBox1.Text);
    rpt.Show();

    or, another way to change the text object directly:

    FastReport.Report rpt = new Report();
    rpt.Load("Label.frx");
    (rpt.FindObject("Text1") as TextObject).Text = textBox1.Text;
    rpt.Show();

    Also read about report parameters here:
    http://www.fast-report.com/documentation/U...tparameters.htm

    Thanks for your answer. The problem has been solved.
    FastReport is really awsome >

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.