Problem loading a report in .Net dll running in ActiveX context
Posted: Fri Oct 14, 2011 8:53 am
We are trying to integrate Stimulsoft Reports into one of our older VB6 ActiveX projects, and we have run into a problem when trying to load a report. Check the attached image for stack trace.
This is how we trigger Stimulsoft Reports:
1) An ActiveX DLL is opened in Internet Explorer
2) When clicking a button in the ActiveX, we create a .Net object from a .Net DLL. VB6 code below:
Set externalObject = CreateObject("DotNetComObject")
externalObject.Start
3) The .Net object opens a new WinForm
4) When clicking a button in the WinForm, the Stimulsoft Report Designer opens. VB.Net code below:
Dim report As New StiReport()
Dim bytearray As Byte()
bytearray = System.IO.File.ReadAllBytes("c:\temp\report.mrt")
report.Load(bytearray)
This works correctly when creating the .Net object in a .Net application, but when using Stimulsoft Reports in an Internet Explorer/ActiveX context, StiReport.Load fails. We have tried loaded the report file into a byte array and then loading the report from the byte array to make sure it had nothing to do with file access.
Any clues on how to solve this?
This is how we trigger Stimulsoft Reports:
1) An ActiveX DLL is opened in Internet Explorer
2) When clicking a button in the ActiveX, we create a .Net object from a .Net DLL. VB6 code below:
Set externalObject = CreateObject("DotNetComObject")
externalObject.Start
3) The .Net object opens a new WinForm
4) When clicking a button in the WinForm, the Stimulsoft Report Designer opens. VB.Net code below:
Dim report As New StiReport()
Dim bytearray As Byte()
bytearray = System.IO.File.ReadAllBytes("c:\temp\report.mrt")
report.Load(bytearray)
This works correctly when creating the .Net object in a .Net application, but when using Stimulsoft Reports in an Internet Explorer/ActiveX context, StiReport.Load fails. We have tried loaded the report file into a byte array and then loading the report from the byte array to make sure it had nothing to do with file access.
Any clues on how to solve this?