Reports from Assemblies
-
- Posts: 53
- Joined: Thu Aug 21, 2008 9:28 pm
- Location: Peru
Reports from Assemblies
Hello
I'm using reports in dll (assemblies) in my programs, i use the following code in VB to load the report:
factura = StiReport.GetReportFromAssembly(My.Application.Info.DirectoryPath & "\Reportes\Formatos\boleta.dll")
factura.RegData(facturaDataSet)
factura.Print(False)
When i upgrade to a new preleased, i get the following error: "Unabled to load one or more of the requested types. Retrieve the LoaderExceptions property for more information"
This is solved recreating the report as assemblie ("save reports as").
Any idea of how can i make to avoid this manual and the update is transparaente?
Thanks
Milton Guevara
Spanish
Hola
Estoy usando reportes en dll (assemblies) en mis programas, utilizo el siguiente codigo en VB para cargar el reporte:
factura = StiReport.GetReportFromAssembly(My.Application.Info.DirectoryPath & "\Reportes\Formatos\boleta.dll")
factura.RegData(facturaDataSet)
factura.Print(False)
Cuando realizo una actualización a un nuevo preleased, me aparece el siguiente error: "Unabled to load one or more of the requested types. Retrieve the LoaderExceptions property for more information"
Esto se soluciona volviendo a crear el reporte como assemblie ("save reports as").
Alguna idea de cómo puedo hacer para evitar este cambio manual y la actualización sea transparaente ?
I'm using reports in dll (assemblies) in my programs, i use the following code in VB to load the report:
factura = StiReport.GetReportFromAssembly(My.Application.Info.DirectoryPath & "\Reportes\Formatos\boleta.dll")
factura.RegData(facturaDataSet)
factura.Print(False)
When i upgrade to a new preleased, i get the following error: "Unabled to load one or more of the requested types. Retrieve the LoaderExceptions property for more information"
This is solved recreating the report as assemblie ("save reports as").
Any idea of how can i make to avoid this manual and the update is transparaente?
Thanks
Milton Guevara
Spanish
Hola
Estoy usando reportes en dll (assemblies) en mis programas, utilizo el siguiente codigo en VB para cargar el reporte:
factura = StiReport.GetReportFromAssembly(My.Application.Info.DirectoryPath & "\Reportes\Formatos\boleta.dll")
factura.RegData(facturaDataSet)
factura.Print(False)
Cuando realizo una actualización a un nuevo preleased, me aparece el siguiente error: "Unabled to load one or more of the requested types. Retrieve the LoaderExceptions property for more information"
Esto se soluciona volviendo a crear el reporte como assemblie ("save reports as").
Alguna idea de cómo puedo hacer para evitar este cambio manual y la actualización sea transparaente ?
Reports from Assemblies
Hello Milton,
You can use following code:
Thank you.
You can use following code:
Code: Select all
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(dataSet);
report.Render();
}
else
{
report.RegData(dataSet);
if (!Directory.Exists(folder))Directory.CreateDirectory(folder);
report.Compile(compiledReportFile);
report.Render();
}
if (!report.IsStopped)
{
report.Show();
}
-
- Posts: 53
- Joined: Thu Aug 21, 2008 9:28 pm
- Location: Peru
Reports from Assemblies
Vital, thank you for your answer, i have some consultations:
1. The problem reported occurs in two situations: when do i update my application to a new version and also when do i update Stimulsoft to a new version. ¿ is this code addresses both cases?
2. The folder "Stimulsoft\\CompiledReports" will keep reports compiled old, will grown indefinitely or deleted automatically?
3. When you modify a report the code also will detect the change and recompile?
Thank you
Spanish:
Vital Gracias por tu respuesta, tengo algunas consultas:
1. El problema reportado ocurre en dos situaciones: cuando yo actualiza mi aplicación a una nueva version y tambien cuando actualizo Stimulsoft a una nueva version. ¿ Este codigo soluciona ambos casos ?
2. La carpeta "Stimulsoft\\CompiledReports" mantendrá reportes compilados antiguos, ¿ crecerá de forma indefenida o se eliminan automaticamante en algun momento ?
3. Cuando modifico un reporte, ¿ el codigo detecta el cambio y recompila ?
1. The problem reported occurs in two situations: when do i update my application to a new version and also when do i update Stimulsoft to a new version. ¿ is this code addresses both cases?
2. The folder "Stimulsoft\\CompiledReports" will keep reports compiled old, will grown indefinitely or deleted automatically?
3. When you modify a report the code also will detect the change and recompile?
Thank you
Spanish:
Vital Gracias por tu respuesta, tengo algunas consultas:
1. El problema reportado ocurre en dos situaciones: cuando yo actualiza mi aplicación a una nueva version y tambien cuando actualizo Stimulsoft a una nueva version. ¿ Este codigo soluciona ambos casos ?
2. La carpeta "Stimulsoft\\CompiledReports" mantendrá reportes compilados antiguos, ¿ crecerá de forma indefenida o se eliminan automaticamante en algun momento ?
3. Cuando modifico un reporte, ¿ el codigo detecta el cambio y recompila ?
Reports from Assemblies
Hello Milton,
GetReportAssemblyCacheName() + myVersionNumber;
Thank you.
If you update Stimulsoft - yes, if you update your application - no. But you can add version of your application to GetReportAssemblyCacheName. For example:1. The problem reported occurs in two situations: when do i update my application to a new version and also when do i update Stimulsoft to a new version. ¿ is this code addresses both cases?
GetReportAssemblyCacheName() + myVersionNumber;
You need add code to delete old reports.2. The folder "Stimulsoft\\CompiledReports" will keep reports compiled old, will grown indefinitely or deleted automatically?
Yes, this code automatically create new assembly for report.3. When you modify a report the code also will detect the change and recompile?
Thank you.
-
- Posts: 53
- Joined: Thu Aug 21, 2008 9:28 pm
- Location: Peru
Reports from Assemblies
Vital
OK, this all clear.
Thank you for your support.
Milton
OK, this all clear.
Thank you for your support.
Milton
-
- Posts: 22
- Joined: Wed Oct 08, 2008 1:57 pm
Reports from Assemblies
Hi
i faced the same problem
also when i use the reports designer to create a report from business object i cannot create a data source using a business object because create new data source
show empty dialog,
and when i open a report created with the an older version of stimulsoft reports.net i cannot compile this report and it show disconnected data source .
All of that was working in the previous version.
Please advice.
i faced the same problem
also when i use the reports designer to create a report from business object i cannot create a data source using a business object because create new data source
show empty dialog,
and when i open a report created with the an older version of stimulsoft reports.net i cannot compile this report and it show disconnected data source .
All of that was working in the previous version.
Please advice.
-
- Posts: 22
- Joined: Wed Oct 08, 2008 1:57 pm
Reports from Assemblies
Hello.
Thank you.
But above you can find a solution for the problem as well. If you still in doubt about possible solution, please send a sample project which illustrates the problem to support[at]stimulsoft.com for analysis and we would help you.i faced the same problem
also when i use the reports designer to create a report from business object i cannot create a data source using a business object because create new data source
show empty dialog,
and when i open a report created with the an older version of stimulsoft reports.net i cannot compile this report and it show disconnected data source .
All of that was working in the previous version.
Please advice.
Thank you.
-
- Posts: 22
- Joined: Wed Oct 08, 2008 1:57 pm
Reports from Assemblies
i am talking about "when i use the reports designer to create a report from business object i cannot create a data source using a business object because create new data source
show empty dialog,
and when i open a report created with the an older version of stimulsoft reports.net i cannot compile this report and it show disconnected data source .
All of that was working in the previous version."
in an older version i was creating the reports from business object very easy now i did not know why i cannot.
show empty dialog,
and when i open a report created with the an older version of stimulsoft reports.net i cannot compile this report and it show disconnected data source .
All of that was working in the previous version."
in an older version i was creating the reports from business object very easy now i did not know why i cannot.
Reports from Assemblies
Hello,
Please try to call "Synchronize" function from Report Dictionary in "Actions" menu.
Thank you.
Please try to call "Synchronize" function from Report Dictionary in "Actions" menu.
Thank you.