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

Stimulsoft Reports.WPF discussion
Post Reply
djjoyro
Posts: 39
Joined: Tue Apr 05, 2011 4:50 am
Location: România

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

Post 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 ?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
djjoyro
Posts: 39
Joined: Tue Apr 05, 2011 4:50 am
Location: România

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

Post 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
Post Reply