After loading assembly could not set variables

Stimulsoft Reports.NET discussion
Post Reply
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

After loading assembly could not set variables

Post by dikan »

I have report that when I am using it with uncompiled report in .MRT my variables that I send to report are Ok and that is exactly what I want but If I make assembly (.DLL) from same .MRT and load that assembly than when I send variables I have no effect. My variables just have default values.

Where I go wrong?

regards,

dikan
Lech Kulikowski
Posts: 7341
Joined: Tue Mar 20, 2018 5:34 am

Re: After loading assembly could not set variables

Post by Lech Kulikowski »

Hello,

Please check the following code:
report["VariableName"] = value;

Thank you.
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

Re: After loading assembly could not set variables

Post by dikan »

I tested variable value on report and value is what I am sending from the application. So that is good but report does not render with this value it is rendered with default value. It looks that I am sending variables to late or I need one more step after loading assembly. With older version of StimulSoft (2016) there is no problem with that. This is only with newer version of StimulSoft libraries.

All files are defined to Connect on Start (default values).

Regards,

dikan
Lech Kulikowski
Posts: 7341
Joined: Tue Mar 20, 2018 5:34 am

Re: After loading assembly could not set variables

Post by Lech Kulikowski »

Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

Re: After loading assembly could not set variables

Post by dikan »

ResetReport();
Report = StiReport.GetReportFromAssembly(fileName);
report.Dictionary.Variables[variableName].ValueObject = value;
((StiSqlDatabase)report.Dictionary.Databases[DataSet]).ConnectionString = connectionString;
Report.Render();
Report.Show(true);

these are the sequence that program executing...

Best regards,

dikan
Lech Kulikowski
Posts: 7341
Joined: Tue Mar 20, 2018 5:34 am

Re: After loading assembly could not set variables

Post by Lech Kulikowski »

Hello,

Please check the following code:
report["VariableName"] = value;

Thank you.
dikan
Posts: 202
Joined: Thu Jun 18, 2009 5:05 pm
Location: Serbia

Re: After loading assembly could not set variables

Post by dikan »

Thank you Lech,
this code does work for compiled reports but does not work for uncompiled reports, so when we detect new version of .mrt we have to use one version of assigning variable value and when we have old version of .mrt we are suppose to use this kind of assigning value to variable. It was confusing to us and never explained clearly.

Best regards,
dikan
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: After loading assembly could not set variables

Post by HighAley »

Hello,

You could check the IsCompiled property of the report and compile the report if it's necessary.

Thank you.
Post Reply