Page 1 of 1
Specific Dll-Version Problem
Posted: Wed Sep 17, 2008 2:41 am
by KrassNub
Hi folks,
since 3 weeks i try this very interesting reporting tool and i must say it is a good one.
I have tried some other tools like CR and List&Label but they have deficits.
Since i have bought List&Label i am a little bit unhappy with it. And
so i want to change the reporting system.
Since i try the actual demo version of Reports.Net i found some problems.
I swapped out our business logic into an independent assembly. But i change the assembly version very
often and if i compile the report, it is fixed to this specific version of the assembly.
If i change the version an exception occurs if i load the assembly with the other version number.
Is it possible to setup the report to an unspecific version of an assembly?
Beside this i have another question. If i load my business object into the designer i changed
StiOptions.Dictionary.BusinessObjects.MaxLevel to 3 because otherwise the reflection tool
creates loops and shows nested properties again and again. Is it possible if i saved a report
to switch on/off the automatic reflection through my business object?
Because if the reflection tool goes through many properties if i compile the report there comes
an error that looks like "Could not find _parentID...".
Thank you for help
KrassNub
Specific Dll-Version Problem
Posted: Wed Sep 17, 2008 5:18 am
by Edward
Hello, KrassNub.
KrassNub wrote:since 3 weeks i try this very interesting reporting tool and i must say it is a good one.
Thank you for your words
I swapped out our business logic into an independent assembly. But i change the assembly version very
often and if i compile the report, it is fixed to this specific version of the assembly.
If i change the version an exception occurs if i load the assembly with the other version number.
Is it possible to setup the report to an unspecific version of an assembly?
Please compile the report from template in this case and store compiled report in assembly. When version of appropriate dll changed the report's dll could be recompiled again. Here is the code snippet for this:
Code: Select all
StiReport stiReport = null;
string compiledReportFile = "report.dll";
if (!File.Exists(compiledReportFile))
{
stiReport = new StiReport();
stiReport.Load("myreport.mrt");
stiReport.Dictionary.DataStore.Clear();
stiReport.Dictionary.Databases.Clear();
stiReport.RegData("MyData", myBusinessObject);
stiReport.Dictionary.Synchronize();
stiReport.Compile(compiledReportFile);
}
else
{
stiReport = StiReport.GetReportFromAssembly(compiledReportFile, true);
stiReport.RegData("MyData", myBusinessObject);
}
Beside this i have another question. If i load my business object into the designer i changed
StiOptions.Dictionary.BusinessObjects.MaxLevel to 3 because otherwise the reflection tool
creates loops and shows nested properties again and again. Is it possible if i saved a report
to switch on/off the automatic reflection through my business object?
Because if the reflection tool goes through many properties if i compile the report there comes
an error that looks like "Could not find _parentID...".
So if got it right second time StiOptions.Dictionary.BusinessObjects.MaxLevel did not equal to 3?
Thank you.
Specific Dll-Version Problem
Posted: Wed Sep 17, 2008 8:50 am
by KrassNub
Hi Edward,
thank you for your fast reply but this answer doesn't satisfy me or i didn't understand it.
Because, if i once designed and compiled a report i dont't want to touch it again or compile it again, except
the stucture will be changed.
My imagination is to design a report, compile it and never touch it again.
But if i change the assembly version number i think the report internal reflection tool saves information to
a specific assembly version. But our assembly version changes every day but not the report.
The report might change all month or something.
Thank you regars,
KrassNub
Specific Dll-Version Problem
Posted: Fri Sep 19, 2008 7:20 pm
by Vital
Hello Nils,
> Since i try the actual demo version of Reports.Net i found some problems.
> I swapped out our business logic into an independent assembly. But i change the assembly version very
> often and if i compile the report, it is fixed to this specific version of the assembly.
> If i change the version an exception occurs if i load the assembly with the other version number.
> Is it possible to setup the report to an unspecific version of an assembly?
This is not our restriction. This is restriction of .Net Framework. How you can solve it:
1. Create a path which you can recompile all report with help of new version of assemblies;
2. Compiled reports only once on first rendering. For example customer try to run report. You checking if compiled version is exist and if it exist then you
need load it from compiled version. If no then you compile report from this version and run report. In next time you run report which previously compiled. If you change
number of assembly version then you recompile report again. Please see sample code:
StiReport report = new StiReport();
report.Load(file);
string folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
folder = Path.Combine(folder, "Stimulsoft\\CompiledReports");
folder = Path.Combine(folder, System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion().ToString());
string compiledReportFile = Path.Combine(folder, report.GetReportAssemblyCacheName());
if (File.Exists(compiledReportFile))
{
report = StiReport.GetReportFromAssembly(compiledReportFile, true);
report.RegData("MyDataSet", dataSet);
report.Render(false);
}
else
{
report.RegData("MyDataSet", dataSet);
if (!Directory.Exists(folder))Directory.CreateDirectory(folder);
report.Compile(compiledReportFile);
report.Render(false);
}
report.Show();
3. You can set assembly versions in config of your application. For example:
[... and etc. for each new assembly ...]
4. Create policy publisher files for every old versions. For example:
policy.2008.1.200.Stimulsoft.Base.dll
policy.2008.1.200.Stimulsoft.Base.dll
policy.2008.1.200.Stimulsoft.Report.dll
etc.
Details - search in MSDN by "publisher policy files".
Thank you.