COM wrapping Stimulsoft

Stimulsoft Reports.NET discussion
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

COM wrapping Stimulsoft

Post 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?
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

COM wrapping Stimulsoft

Post 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.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

COM wrapping Stimulsoft

Post 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?
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

COM wrapping Stimulsoft

Post by fuhrj »

I've determined what the problem was.

I did not have the Stim*.dlls in the same folder with the VB executable.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

COM wrapping Stimulsoft

Post by Andrew »

Hello,

Do I understand you correct that the issues is solved?

Thank you.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

COM wrapping Stimulsoft

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

COM wrapping Stimulsoft

Post 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.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

COM wrapping Stimulsoft

Post 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.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

COM wrapping Stimulsoft

Post 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...
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

COM wrapping Stimulsoft

Post by Alex K. »

Hello,

Can you please send us a sample project which reproduces the issue for analysis.

Thank you.
Post Reply