Page 1 of 1

How to (re)Render after load for setting new value for a variable

Posted: Wed Aug 17, 2011 7:28 am
by djjoyro
I'm using Stimulsoft Reporting for WPF. I have saved a rendered report (in the database in binary format). When I'm loading the report I can view it in Stimulsoft Report Viewer.

I would like to register a new value for a variable (which was already rendered). Is this posible?

If I'm trying with report["variableName"]="xxxxx" it doesn't do anything. If I (re)render the report it becomes blank.

Ideeas ?

How to (re)Render after load for setting new value for a variable

Posted: Wed Aug 17, 2011 8:55 am
by HighAley
Hello.

> I'm using Stimulsoft Reporting for WPF. I have saved a rendered report (in the database in binary format). When I'm loading the report I can view it in Stimulsoft Report Viewer.
>
> I would like to register a new value for a variable (which was already rendered). Is this posible?
>
> If I'm trying with report["variableName"]="xxxxx" it doesn't do anything. If I (re)render the report it becomes blank.
>
> Ideeas ?

There are no variables in rendered report. If you want to change variable you can do it in report template and then render the report once again.
You can change only specific text field but it will not change the size of itself.

Thank you.

How to (re)Render after load for setting new value for a variable

Posted: Wed Aug 17, 2011 8:55 am
by HighAley
Hello.
I'm using Stimulsoft Reporting for WPF. I have saved a rendered report (in the database in binary format). When I'm loading the report I can view it in Stimulsoft Report Viewer.
I would like to register a new value for a variable (which was already rendered). Is this posible?
If I'm trying with report["variableName"]="xxxxx" it doesn't do anything. If I (re)render the report it becomes blank.
Ideeas ?
There are no variables in rendered report. If you want to change variable you can do it in report template and then render the report once again.
You can change only specific text field but it will not change the size of itself.

Thank you.

How to (re)Render after load for setting new value for a variable

Posted: Wed Aug 17, 2011 10:21 am
by djjoyro
You can change only specific text field but it will not change the size of itself.
Do you mean I can change some text fields after the report is rendered ? Can you help me how can I do that ? I need to change only a little text.

Thanks.

How to (re)Render after load for setting new value for a variable

Posted: Thu Aug 18, 2011 6:49 am
by HighAley
Hello.
djjoyro wrote:Do you mean I can change some text fields after the report is rendered ? Can you help me how can I do that ? I need to change only a little text.
You can get component by name rep.RenderedPages.GetComponentByName(); but it will be the first component of report with such name.

Or you can do it this way

Code: Select all

foreach (StiPage page in rep.RenderedPages)
{
  foreach (StiComponent comp in page.Components)
  {
    if (comp.Name == "Text1")
    {
      (comp as StiText).Text = "xxxxxxx";
    }
  }
}
Thank you.