Page 1 of 1
After loading assembly could not set variables
Posted: Fri Oct 02, 2020 7:07 pm
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
Re: After loading assembly could not set variables
Posted: Mon Oct 05, 2020 1:29 pm
by Lech Kulikowski
Hello,
Please check the following code:
report["VariableName"] = value;
Thank you.
Re: After loading assembly could not set variables
Posted: Mon Oct 05, 2020 8:39 pm
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
Re: After loading assembly could not set variables
Posted: Tue Oct 06, 2020 9:08 am
by Lech Kulikowski
Hello,
Please send us a sample project that reproduces the issue for analysis.
Thank you.
Re: After loading assembly could not set variables
Posted: Wed Oct 07, 2020 7:47 am
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
Re: After loading assembly could not set variables
Posted: Wed Oct 07, 2020 8:11 pm
by Lech Kulikowski
Hello,
Please check the following code:
report["VariableName"] = value;
Thank you.
Re: After loading assembly could not set variables
Posted: Mon Oct 12, 2020 7:40 pm
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
Re: After loading assembly could not set variables
Posted: Wed Oct 14, 2020 1:19 pm
by HighAley
Hello,
You could check the IsCompiled property of the report and compile the report if it's necessary.
Thank you.