Silverlight - Overwriting Variables takes no effect

Stimulsoft Reports.Silverlight discussion
Locked
christian1989
Posts: 7
Joined: Tue Feb 14, 2012 5:05 am
Location: Vienna

Silverlight - Overwriting Variables takes no effect

Post by christian1989 »

Hi!

I have a template which is loaded at the startup, this one has 2 variables "From" and "To2 (each is a datetime).
I´m overwriting this variables to Today and Yesterday:

report["From"] = DateTime.Today.AddDays(-1);
report["To"] = DateTime.Now;

And also setting a ID-Collection for my SQL-Query:
report["Ids"] = App.UserData.SelectedIDs; //Is a List

But if i click on preview, i see the DateTime Pickers but the old datetime is selected (which is stored in the mrt file).
The same appears if i send a RenderRequest to the WCF Service. The Services gets the old values not the overwritten ones ?

Would be glad to read a solution for this problem as quick as possible.
Greets
Christian


Edit: I use the latest Build of last week.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Silverlight - Overwriting Variables takes no effect

Post by HighAley »

Hello, Christian.
christian1989 wrote:I have a template which is loaded at the startup, this one has 2 variables "From" and "To2 (each is a datetime).
I´m overwriting this variables to Today and Yesterday:

report["From"] = DateTime.Today.AddDays(-1);
report["To"] = DateTime.Now;

And also setting a ID-Collection for my SQL-Query:
report["Ids"] = App.UserData.SelectedIDs; //Is a List

But if i click on preview, i see the DateTime Pickers but the old datetime is selected (which is stored in the mrt file).
The same appears if i send a RenderRequest to the WCF Service. The Services gets the old values not the overwritten ones ?

Would be glad to read a solution for this problem as quick as possible.
Please, try to set variables value with next code:

Code: Select all

report.Dictionary.Variables["From"].ValueObject = DateTime.Today.AddDays(-1);
report.Dictionary.Variables["To"].ValueObject = DateTime.Now;
report["From"] expression you could use after compiling report only.

Thank you.
christian1989
Posts: 7
Joined: Tue Feb 14, 2012 5:05 am
Location: Vienna

Silverlight - Overwriting Variables takes no effect

Post by christian1989 »

Hi!

Thank you for your answer, now it works.
But i think i have found another bug.

I attach to the following event:
StiOptions.Silverlight.WCFService.WCFRenderReport += WCFRenderReport;

But if i create a new report (New --> Blank Report) in the designer and click on preview, the event is risen but the "object sender" argument is null (!!).


Another "bug"?
If i click on submit in the preview form (which sets the variables), the preview button and the input form is disappearing, i have to switch to the designer and afterwards again to preview to click again on "Submit" ?!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Silverlight - Overwriting Variables takes no effect

Post by HighAley »

Hello.
christian1989 wrote:I attach to the following event:
StiOptions.Silverlight.WCFService.WCFRenderReport += WCFRenderReport;

But if i create a new report (New --> Blank Report) in the designer and click on preview, the event is risen but the "object sender" argument is null (!!).
We've fixed this problem, the patch will be available in our next prerelease build this week.
christian1989 wrote:If i click on submit in the preview form (which sets the variables), the preview button and the input form is disappearing, i have to switch to the designer and afterwards again to preview to click again on "Submit" ?!
We couldn't reproduce this issue. Could you describe it more detailed or send us a video with it.

Thank you.
Locked