Page 1 of 2
COM wrapping Stimulsoft
Posted: Thu Jul 21, 2011 7:57 am
by fuhrj
I need to use the reporting components in a VB6 project. I created a C# COM Visible to run the report but I am getting this error:
Unable to cast object of type 'System.String' to type 'Stimulsoft.Report.Dictionary.StiDataParameter'
The report runs correctly in Report Designer.
Any ideas where I should look?
COM wrapping Stimulsoft
Posted: Thu Jul 21, 2011 9:18 am
by Andrew
Hello,
This error can occur if the computer from the library are of different versions of our product.
Please check whether the version of the libraries used in your product is the same.
Thank you.
COM wrapping Stimulsoft
Posted: Thu Jul 21, 2011 9:51 am
by fuhrj
Andrew wrote:Hello,
This error can occur if the computer from the library are of different versions of our product.
Please check whether the version of the libraries used in your product is the same.
Thank you.
Thanks for the quick response.
I've verified that the Designer.exe used to create the report and the Stim*.dlls used to build the DLL are the same.
Anything else I can check?
COM wrapping Stimulsoft
Posted: Thu Jul 21, 2011 10:00 am
by fuhrj
I've determined what the problem was.
I did not have the Stim*.dlls in the same folder with the VB executable.
COM wrapping Stimulsoft
Posted: Thu Jul 21, 2011 1:26 pm
by Andrew
Hello,
Do I understand you correct that the issues is solved?
Thank you.
COM wrapping Stimulsoft
Posted: Thu Jul 21, 2011 8:04 pm
by fuhrj
I'm still having an issue....
The report will execute if I just use report.show();
But if I use the following code, I get an error:
Code: Select all
report.Render(false);
report.ExportDocument(StiExportFormat.Pdf, "report.pdf");
The error I get is:
Could not load file or assembly 'System.Data.dll' or one of its dependencies. The System cannot find the file specified
It's only if I call the report.Render() which I need to do in order to create the PDF.
COM wrapping Stimulsoft
Posted: Fri Jul 22, 2011 2:07 am
by Alex K.
Hello,
We found some strangeness in work of .NET Framework 4.0. In some cases, the compiled project cannot load the System.Data.dll system library, although the link to the library project is added.
You should do the following to solve this problem:
in start of your application please add the following lines of code:
using System.Data;
....
DataSet ds = null;
This lines of code will be force to load System.Data library in the memory.
Thank you.
COM wrapping Stimulsoft
Posted: Fri Jul 22, 2011 7:37 am
by fuhrj
Aleksey wrote:Hello,
We found some strangeness in work of .NET Framework 4.0. In some cases, the compiled project cannot load the System.Data.dll system library, although the link to the library project is added.
You should do the following to solve this problem:
in start of your application please add the following lines of code:
using System.Data;
....
DataSet ds = null;
This lines of code will be force to load System.Data library in the memory.
Thank you.
My COM wrapper only loads the report and then shows it. It uses the Datasource inside the report so I'm not passing in a Dataset.
However, I recompiled the COM Wrapper with the 4.0 framework instead of 2.0 and it now works.
I really don't want to use the 4.0 framework because many of our customers are still on XP. If I wanted to use the 2.0 framework, what version of the Stimulsoft controls should I use? Currently I am using the latest, April 2011 build.
COM wrapping Stimulsoft
Posted: Fri Jul 22, 2011 8:21 am
by fuhrj
To resolve this issue so that I can use at least the 3.5 framework, I had to rebuild my COM wrapper with the Stimulsoft library to version 2010.2.800 (10/2010).
This is fine, but I would prefer to use the latest build...
COM wrapping Stimulsoft
Posted: Mon Jul 25, 2011 1:18 am
by Alex K.
Hello,
Can you please send us a sample project which reproduces the issue for analysis.
Thank you.