Compiled report question
-
- Posts: 251
- Joined: Fri Feb 04, 2011 11:46 am
- Location: San Diego, CA
Compiled report question
After I call GetReportFromAssembly to load a pre-compiled report, can I add variables, and datasources via C# still? Or is that only available for reports that load .MRT files?
Compiled report question
Hello,
You can use the following code:
Thank you.
You can use the following code:
Code: Select all
report.Dictionary.Variables.Add();
report.Dictionary.DataSources.Add();
-
- Posts: 251
- Joined: Fri Feb 04, 2011 11:46 am
- Location: San Diego, CA
Compiled report question
That does not seem to work for compiled reports.
No matter what variables I add/change, running a compiled report does not see the variables. I have tried changing the variables value in the report.Dictionary.Variables collection in the dictionary, and the running report does not see the changes.
I am just placing a variable in the header like this {var1}
I even do a
report.Dictionary.Variables.Clear();
but when I run the report it still "sees" the variables that were there when the report was compiled (I would have expected a runtime error).
Setting/changing variables works perfectly when I use report.Load, so are you sure StiReport.GetReportFromAssembly supports changing variables after a compiled report (.dll) is loaded?
Jay
No matter what variables I add/change, running a compiled report does not see the variables. I have tried changing the variables value in the report.Dictionary.Variables collection in the dictionary, and the running report does not see the changes.
I am just placing a variable in the header like this {var1}
I even do a
report.Dictionary.Variables.Clear();
but when I run the report it still "sees" the variables that were there when the report was compiled (I would have expected a runtime error).
Setting/changing variables works perfectly when I use report.Load, so are you sure StiReport.GetReportFromAssembly supports changing variables after a compiled report (.dll) is loaded?
Jay
Compiled report question
Hello,
In this case, you can use the following code to get access to variables or datasources:
Thank you.
In this case, you can use the following code to get access to variables or datasources:
Code: Select all
report["Variable1"] = ;
report["DataSourceName"] = ;
...
-
- Posts: 251
- Joined: Fri Feb 04, 2011 11:46 am
- Location: San Diego, CA
Compiled report question
That syntax for variables seems to work better ... but it only allows setting of strings (instead of StiVariable). I have A LOT of logic that manipulates the variables collection with code like this:
report.Dictionary.Variables[TempName] = new StiVariable(null, TempName, TempName, typeof(string), entry._sText, true);
Is there any reason manipulating the report.Dictionary.Variables directly does not work for compiled reports?
Thanks,
Jay
report.Dictionary.Variables[TempName] = new StiVariable(null, TempName, TempName, typeof(string), entry._sText, true);
Is there any reason manipulating the report.Dictionary.Variables directly does not work for compiled reports?
Thanks,
Jay
Compiled report question
Hello,
[quote="jay"@bplogix.com]That syntax for variables seems to work better ... but it only allows setting of strings [/quote]
We couldn't reproduce this bug.
Can you please send us a simple test project, which reproduce the issue?
[quote="jay"@bplogix.com]Is there any reason manipulating the report.Dictionary.Variables directly does not work for compiled reports?[/quote]
In compiled report all variables are compiled to class members, so you can not override them.
Thank you.
[quote="jay"@bplogix.com]That syntax for variables seems to work better ... but it only allows setting of strings [/quote]
We couldn't reproduce this bug.
Can you please send us a simple test project, which reproduce the issue?
[quote="jay"@bplogix.com]Is there any reason manipulating the report.Dictionary.Variables directly does not work for compiled reports?[/quote]
In compiled report all variables are compiled to class members, so you can not override them.
Thank you.