Office Web Charts Compatibility Issue

Office Web Charts Compatibility Issue

Post by Chuck Cob » Fri, 31 May 2002 20:23:44



I have a VB application that I've converted to DotNet that uses the Office
Web Chart Components to draw graphs.  There is apparently an incompatibility
between the OWC10.DLL component and DotNet Interop Services.

The application fails on the following call:
    Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
ChartWidth, ChartHeight)

with the following error:
   System.Runtime.InteropServices.SafeArrayTypeMismatchException: Specified
array was not of the expected type

Apparently DotNet Interop Services doesn't like the variable that OWC10.DLL
is attempting to return, but its returning an "Object".  Inside of the
object is a binary array of the form Byte(), but I haven't even gotten to
the point of doing a type conversion on it.  It fails when it trys to
receive it as an object.  I'm not sure I understand why this is happening.
Is DotNet looking inside of the Object variable and finding something it
doesn't like?  Does anyone know of a solution to this problem?

Thanks,

Chuck

 
 
 

Office Web Charts Compatibility Issue

Post by Martij » Fri, 31 May 2002 20:42:24


Hi Chuck,

Try adding the following in the Page directive of your aspx file:

AspCompat="true"

Martijn


Quote:> I have a VB application that I've converted to DotNet that uses the Office
> Web Chart Components to draw graphs.  There is apparently an
incompatibility
> between the OWC10.DLL component and DotNet Interop Services.

> The application fails on the following call:
>     Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
> ChartWidth, ChartHeight)

> with the following error:
>    System.Runtime.InteropServices.SafeArrayTypeMismatchException:
Specified
> array was not of the expected type

> Apparently DotNet Interop Services doesn't like the variable that
OWC10.DLL
> is attempting to return, but its returning an "Object".  Inside of the
> object is a binary array of the form Byte(), but I haven't even gotten to
> the point of doing a type conversion on it.  It fails when it trys to
> receive it as an object.  I'm not sure I understand why this is happening.
> Is DotNet looking inside of the Object variable and finding something it
> doesn't like?  Does anyone know of a solution to this problem?

> Thanks,

> Chuck


 
 
 

Office Web Charts Compatibility Issue

Post by Chuck Cob » Fri, 31 May 2002 21:20:20


Thanks Martijn...that looks like an excellent lead...that may be the
problem, but I have a couple of questions:

I did some reading on the Microsoft Knowledge Base about "AspCompat" and it
recommends adding
the following command to ASP.Net pages:


That looks like old ASP code, not ASP.Net code...I don't understand how you
put code like that in an ASP.Net
page.  I tried it and it didn't work...the ASP.Net page wants to see VB code
and that's HTML code.

Another question is this call that I'm having a problem with is not on the
ASPx page at all.  It's in a separately
compiled DLL assembly (I've developed my own "wrapper" DLL around the Office
Web Components).
That might mean I'm sunk without a solution...

Here's a quote from an article on this subject:

STA components cannot be used from .NET Framework code modules (compiled
.NET assemblies); they can be used only from ASP.NET pages

(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...
ml/cpconcomcomponentcompatibility.asp)

Thanks for your help,

Chuck


> Hi Chuck,

> Try adding the following in the Page directive of your aspx file:

> AspCompat="true"

> Martijn



> > I have a VB application that I've converted to DotNet that uses the
Office
> > Web Chart Components to draw graphs.  There is apparently an
> incompatibility
> > between the OWC10.DLL component and DotNet Interop Services.

> > The application fails on the following call:
> >     Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
> > ChartWidth, ChartHeight)

> > with the following error:
> >    System.Runtime.InteropServices.SafeArrayTypeMismatchException:
> Specified
> > array was not of the expected type

> > Apparently DotNet Interop Services doesn't like the variable that
> OWC10.DLL
> > is attempting to return, but its returning an "Object".  Inside of the
> > object is a binary array of the form Byte(), but I haven't even gotten
to
> > the point of doing a type conversion on it.  It fails when it trys to
> > receive it as an object.  I'm not sure I understand why this is
happening.
> > Is DotNet looking inside of the Object variable and finding something it
> > doesn't like?  Does anyone know of a solution to this problem?

> > Thanks,

> > Chuck

 
 
 

Office Web Charts Compatibility Issue

Post by Chuck Cob » Fri, 31 May 2002 21:29:46


Hi Martijn,

Disregard previous response....I figured out how to add the ASPCompat=True
to the HTML Source and it worked.

Thanks!

Chuck


> Thanks Martijn...that looks like an excellent lead...that may be the
> problem, but I have a couple of questions:

> I did some reading on the Microsoft Knowledge Base about "AspCompat" and
it
> recommends adding
> the following command to ASP.Net pages:


> That looks like old ASP code, not ASP.Net code...I don't understand how
you
> put code like that in an ASP.Net
> page.  I tried it and it didn't work...the ASP.Net page wants to see VB
code
> and that's HTML code.

> Another question is this call that I'm having a problem with is not on the
> ASPx page at all.  It's in a separately
> compiled DLL assembly (I've developed my own "wrapper" DLL around the
Office
> Web Components).
> That might mean I'm sunk without a solution...

> Here's a quote from an article on this subject:

> STA components cannot be used from .NET Framework code modules (compiled
> .NET assemblies); they can be used only from ASP.NET pages

(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...

- Show quoted text -

> ml/cpconcomcomponentcompatibility.asp)

> Thanks for your help,

> Chuck



> > Hi Chuck,

> > Try adding the following in the Page directive of your aspx file:

> > AspCompat="true"

> > Martijn



> > > I have a VB application that I've converted to DotNet that uses the
> Office
> > > Web Chart Components to draw graphs.  There is apparently an
> > incompatibility
> > > between the OWC10.DLL component and DotNet Interop Services.

> > > The application fails on the following call:
> > >     Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
> > > ChartWidth, ChartHeight)

> > > with the following error:
> > >    System.Runtime.InteropServices.SafeArrayTypeMismatchException:
> > Specified
> > > array was not of the expected type

> > > Apparently DotNet Interop Services doesn't like the variable that
> > OWC10.DLL
> > > is attempting to return, but its returning an "Object".  Inside of the
> > > object is a binary array of the form Byte(), but I haven't even gotten
> to
> > > the point of doing a type conversion on it.  It fails when it trys to
> > > receive it as an object.  I'm not sure I understand why this is
> happening.
> > > Is DotNet looking inside of the Object variable and finding something
it
> > > doesn't like?  Does anyone know of a solution to this problem?

> > > Thanks,

> > > Chuck

 
 
 

Office Web Charts Compatibility Issue

Post by Martij » Fri, 31 May 2002 21:44:01


Chuck..

An ASP.NET page exists of an aspx file and an aspx.cs file. The code in the
aspx.cs file is compiled into the dll in the bin directory.
The first line in your aspx file is something like:

AutoEventWireup="false" Inherits="Project.Graph"%>
You need to add AspCompat="true" to this line.....

So your new line should say:

AutoEventWireup="false" Inherits="Project.Graph" AspCompat="true"%>

Have you tried it exactely as abonve, 'cause I believe it's case
sensitive.........

I had the same problem with OWC10, it worked without the AspCompat... on
WinXP pro and failed on Win2k.....

(I don't know if it works with your wrapper dll...)

Martijn


> Thanks Martijn...that looks like an excellent lead...that may be the
> problem, but I have a couple of questions:

> I did some reading on the Microsoft Knowledge Base about "AspCompat" and
it
> recommends adding
> the following command to ASP.Net pages:


> That looks like old ASP code, not ASP.Net code...I don't understand how
you
> put code like that in an ASP.Net
> page.  I tried it and it didn't work...the ASP.Net page wants to see VB
code
> and that's HTML code.

> Another question is this call that I'm having a problem with is not on the
> ASPx page at all.  It's in a separately
> compiled DLL assembly (I've developed my own "wrapper" DLL around the
Office
> Web Components).
> That might mean I'm sunk without a solution...

> Here's a quote from an article on this subject:

> STA components cannot be used from .NET Framework code modules (compiled
> .NET assemblies); they can be used only from ASP.NET pages

(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgu...

- Show quoted text -

> ml/cpconcomcomponentcompatibility.asp)

> Thanks for your help,

> Chuck



> > Hi Chuck,

> > Try adding the following in the Page directive of your aspx file:

> > AspCompat="true"

> > Martijn



> > > I have a VB application that I've converted to DotNet that uses the
> Office
> > > Web Chart Components to draw graphs.  There is apparently an
> > incompatibility
> > > between the OWC10.DLL component and DotNet Interop Services.

> > > The application fails on the following call:
> > >     Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
> > > ChartWidth, ChartHeight)

> > > with the following error:
> > >    System.Runtime.InteropServices.SafeArrayTypeMismatchException:
> > Specified
> > > array was not of the expected type

> > > Apparently DotNet Interop Services doesn't like the variable that
> > OWC10.DLL
> > > is attempting to return, but its returning an "Object".  Inside of the
> > > object is a binary array of the form Byte(), but I haven't even gotten
> to
> > > the point of doing a type conversion on it.  It fails when it trys to
> > > receive it as an object.  I'm not sure I understand why this is
> happening.
> > > Is DotNet looking inside of the Object variable and finding something
it
> > > doesn't like?  Does anyone know of a solution to this problem?

> > > Thanks,

> > > Chuck

 
 
 

Office Web Charts Compatibility Issue

Post by ac » Fri, 31 May 2002 22:28:03


Hi, have you use the tlbimp.exe?
Done this you'll get the dll
to put in the bin directory (of your application).
Done this the namespace and declarations are (for ex.):


...
Dim chAxisPositionCategory As OWC10.ChartDimensionsEnum
Dim chDimValues As OWC10.ChartDimensionsEnum
Dim chDimCategories As OWC10.ChartDimensionsEnum
Dim chAxisPositionLeft As OWC10.ChartDimensionsEnum
Dim chDataLiteral As OWC10.ChartDimensionsEnum
Dim owc As new OWC10.ChartSpace
Dim owcChart As OWC10.ChChart
Dim owcSeries As OWC10.ChSeries
Dim owcConst
...
owc.clear
owcChart = owc.charts.add
owcConst = owc.constants
owcSeries = owcChart.seriesCollection.add
owc.Border.Color = owcConst.chColorNone
...

Hope this helps /// Angelo

----- Original Message -----

Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Thursday, May 30, 2002 1:23 PM
Subject: Office Web Charts Compatibility Issue

> I have a VB application that I've converted to DotNet that uses the Office
> Web Chart Components to draw graphs.  There is apparently an
incompatibility
> between the OWC10.DLL component and DotNet Interop Services.

> The application fails on the following call:
>     Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
> ChartWidth, ChartHeight)

> with the following error:
>    System.Runtime.InteropServices.SafeArrayTypeMismatchException:
Specified
> array was not of the expected type

> Apparently DotNet Interop Services doesn't like the variable that
OWC10.DLL
> is attempting to return, but its returning an "Object".  Inside of the
> object is a binary array of the form Byte(), but I haven't even gotten to
> the point of doing a type conversion on it.  It fails when it trys to
> receive it as an object.  I'm not sure I understand why this is happening.
> Is DotNet looking inside of the Object variable and finding something it
> doesn't like?  Does anyone know of a solution to this problem?

> Thanks,

> Chuck

 
 
 

Office Web Charts Compatibility Issue

Post by Chuck Cob » Fri, 31 May 2002 22:48:52


Hi Angelo...

I found the solution to my problem...I had to put "ASPCompat=True" in my
page directive in the ASPx web page.  That was all I needed to do.
Apparently OWC is a single threaded component and you have to do that to
make it compatible.

Thanks for your help,

Chuck


> Hi, have you use the tlbimp.exe?
> Done this you'll get the dll
> to put in the bin directory (of your application).
> Done this the namespace and declarations are (for ex.):


> ...
> Dim chAxisPositionCategory As OWC10.ChartDimensionsEnum
> Dim chDimValues As OWC10.ChartDimensionsEnum
> Dim chDimCategories As OWC10.ChartDimensionsEnum
> Dim chAxisPositionLeft As OWC10.ChartDimensionsEnum
> Dim chDataLiteral As OWC10.ChartDimensionsEnum
> Dim owc As new OWC10.ChartSpace
> Dim owcChart As OWC10.ChChart
> Dim owcSeries As OWC10.ChSeries
> Dim owcConst
> ...
> owc.clear
> owcChart = owc.charts.add
> owcConst = owc.constants
> owcSeries = owcChart.seriesCollection.add
> owc.Border.Color = owcConst.chColorNone
> ...

> Hope this helps /// Angelo

> ----- Original Message -----

> Newsgroups: microsoft.public.dotnet.framework.aspnet
> Sent: Thursday, May 30, 2002 1:23 PM
> Subject: Office Web Charts Compatibility Issue

> > I have a VB application that I've converted to DotNet that uses the
Office
> > Web Chart Components to draw graphs.  There is apparently an
> incompatibility
> > between the OWC10.DLL component and DotNet Interop Services.

> > The application fails on the following call:
> >     Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
> > ChartWidth, ChartHeight)

> > with the following error:
> >    System.Runtime.InteropServices.SafeArrayTypeMismatchException:
> Specified
> > array was not of the expected type

> > Apparently DotNet Interop Services doesn't like the variable that
> OWC10.DLL
> > is attempting to return, but its returning an "Object".  Inside of the
> > object is a binary array of the form Byte(), but I haven't even gotten
to
> > the point of doing a type conversion on it.  It fails when it trys to
> > receive it as an object.  I'm not sure I understand why this is
happening.
> > Is DotNet looking inside of the Object variable and finding something it
> > doesn't like?  Does anyone know of a solution to this problem?

> > Thanks,

> > Chuck

 
 
 

1. Office Web Charts DotNet Compatibility Issue

I have a VB application that I've converted to DotNet that uses the Office
Web Chart Components to draw graphs.  There is apparently an incompatibility
between the OWC10.DLL component and DotNet Interop Services.

The application fails on the following call:
    Dim objBinaryData As Object = ChartSpaceObj.GetPicture(FileType,
ChartWidth, ChartHeight)

with the following error:
   System.Runtime.InteropServices.SafeArrayTypeMismatchException: Specified
array was not of the expected type

Apparently DotNet Interop Services doesn't like the variable that OWC10.DLL
is attempting to return, but its returning an "Object".  Inside of the
object is a binary array of the form Byte(), but I haven't even gotten to
the point of doing a type conversion on it.  It fails when it trys to
receive it as an object.  I'm not sure I understand why this is happening.
Is DotNet looking inside of the Object variable and finding something it
doesn't like?  Does anyone know of a solution to this problem?

Thanks,

Chuck

2. HELP!! How to IMPORT table only data ..

3. netBook/7 microphone problems solved!!!!

4. office 2000 chart web control problem

5. Digital Doves Typeface?

6. Office web component CHART question

7. Problem with display of text in certain programs.

8. charts in .net w/ office web components

9. charts in .net with office web components

10. Crystal Reports Web Form Chart Display Issue in VS.net

11. URGENT Help : Office XP OWC 10 Chart - Events Not Working

12. URGENT : Office XP OWC 10 Chart - Events Not Working