I am attempting to use VB.Net to interface to a CSharp DLL to print reports.
I have taken the CSharp Example that I have seen reported in this newsgroup
and made it into a DLL. I am trying to use the Reporting Services report
parameter and getting the following error in VB.Net:
TestApp.vb(613): Value of type '1-dimensional array of
TestApp.ParameterValue' cannot be converted to '1-dimensional array of
ParameterValue' because 'TestApp.ParameterValue' is not derived from
'ParameterValue'.
In the public function in the CSharp DLL, I am looking for three parameters.
public bool PrintReport(string reportPath, ParameterValue[]
reportParameters, string printer)
In VB, I am calling the function like this:
PrintServer.PrintReport(ReportURL, ReportParameters, Printer)
Here is how I have declared the ReportParameters object:
Private ReportParameters(4) as ParameterValue
Can someone please explain to me the error message and how to fix it?Hi. Try fully declaring your ParameterValue[] parameter with the same
namespace as that of the cSharp library.
Regards,
Tim Ellison, MCP
Ironworks Consulting, LLC
(m) 804.405.4874
"Mike Collins" <MikeCollins@.discussions.microsoft.com> wrote in message
news:2DF92759-B44A-4D8B-A2D5-028EE17FF7FB@.microsoft.com...
> I am attempting to use VB.Net to interface to a CSharp DLL to print
reports.
> I have taken the CSharp Example that I have seen reported in this
newsgroup
> and made it into a DLL. I am trying to use the Reporting Services report
> parameter and getting the following error in VB.Net:
> TestApp.vb(613): Value of type '1-dimensional array of
> TestApp.ParameterValue' cannot be converted to '1-dimensional array of
> ParameterValue' because 'TestApp.ParameterValue' is not derived from
> 'ParameterValue'.
> In the public function in the CSharp DLL, I am looking for three
parameters.
> public bool PrintReport(string reportPath, ParameterValue[]
> reportParameters, string printer)
> In VB, I am calling the function like this:
> PrintServer.PrintReport(ReportURL, ReportParameters, Printer)
> Here is how I have declared the ReportParameters object:
> Private ReportParameters(4) as ParameterValue
> Can someone please explain to me the error message and how to fix it?
>|||Thanks for the response Tim, but I am not sure what you mean by declcaring
ParameterValue[] parameter with the same namespance as that of the cSharp
library.
I tried what I believe you were saying in my VB declaration:
Private ReportParameters(4) as SQLPrintServer.localhost.ParameterValue, with
SQLPrintServer being the namespace of my cSharp library, and got the same
error message.
TestApp.vb(570): Value of type '1-dimensional array of
SQLPrintServer.localhost.ParameterValue' cannot be converted to
'1-dimensional array of TestApp.ParameterValue' because
'SQLPrintServer.localhost.ParameterValue' is not derived from
'TestApp.ParameterValue'.
"TIM ELLISON" wrote:
> Hi. Try fully declaring your ParameterValue[] parameter with the same
> namespace as that of the cSharp library.
>
> --
> Regards,
> Tim Ellison, MCP
> Ironworks Consulting, LLC
> (m) 804.405.4874
> "Mike Collins" <MikeCollins@.discussions.microsoft.com> wrote in message
> news:2DF92759-B44A-4D8B-A2D5-028EE17FF7FB@.microsoft.com...
> > I am attempting to use VB.Net to interface to a CSharp DLL to print
> reports.
> > I have taken the CSharp Example that I have seen reported in this
> newsgroup
> > and made it into a DLL. I am trying to use the Reporting Services report
> > parameter and getting the following error in VB.Net:
> >
> > TestApp.vb(613): Value of type '1-dimensional array of
> > TestApp.ParameterValue' cannot be converted to '1-dimensional array of
> > ParameterValue' because 'TestApp.ParameterValue' is not derived from
> > 'ParameterValue'.
> >
> > In the public function in the CSharp DLL, I am looking for three
> parameters.
> >
> > public bool PrintReport(string reportPath, ParameterValue[]
> > reportParameters, string printer)
> >
> > In VB, I am calling the function like this:
> > PrintServer.PrintReport(ReportURL, ReportParameters, Printer)
> >
> > Here is how I have declared the ReportParameters object:
> > Private ReportParameters(4) as ParameterValue
> >
> > Can someone please explain to me the error message and how to fix it?
> >
> >
>
>|||Your web reference is going to create a namespace inside which the proxy for
the web service resides. I'm assuming from your code that it's
"SQLPrintServer.localhost".
You also have a test application whose default namespace appears to be
"TestApp".
A fully qualified name for a class is "NameSpace.ClassName". Therefore,
"SQLPrintServer.localhost.Parameter" is not equivalent to
"TestApp.Parameter".
Can you provide the code please? That might help.
--
Regards,
Tim Ellison, MCP
Ironworks Consulting, LLC
(m) 804.405.4874
"Mike Collins" <MikeCollins@.discussions.microsoft.com> wrote in message
news:B1D28046-E92D-4336-8B1E-AD826C084505@.microsoft.com...
> Thanks for the response Tim, but I am not sure what you mean by declcaring
> ParameterValue[] parameter with the same namespance as that of the cSharp
> library.
> I tried what I believe you were saying in my VB declaration:
> Private ReportParameters(4) as SQLPrintServer.localhost.ParameterValue,
with
> SQLPrintServer being the namespace of my cSharp library, and got the same
> error message.
> TestApp.vb(570): Value of type '1-dimensional array of
> SQLPrintServer.localhost.ParameterValue' cannot be converted to
> '1-dimensional array of TestApp.ParameterValue' because
> 'SQLPrintServer.localhost.ParameterValue' is not derived from
> 'TestApp.ParameterValue'.
> "TIM ELLISON" wrote:
> > Hi. Try fully declaring your ParameterValue[] parameter with the same
> > namespace as that of the cSharp library.
> >
> >
> > --
> > Regards,
> >
> > Tim Ellison, MCP
> > Ironworks Consulting, LLC
> > (m) 804.405.4874
> > "Mike Collins" <MikeCollins@.discussions.microsoft.com> wrote in message
> > news:2DF92759-B44A-4D8B-A2D5-028EE17FF7FB@.microsoft.com...
> > > I am attempting to use VB.Net to interface to a CSharp DLL to print
> > reports.
> > > I have taken the CSharp Example that I have seen reported in this
> > newsgroup
> > > and made it into a DLL. I am trying to use the Reporting Services
report
> > > parameter and getting the following error in VB.Net:
> > >
> > > TestApp.vb(613): Value of type '1-dimensional array of
> > > TestApp.ParameterValue' cannot be converted to '1-dimensional array of
> > > ParameterValue' because 'TestApp.ParameterValue' is not derived from
> > > 'ParameterValue'.
> > >
> > > In the public function in the CSharp DLL, I am looking for three
> > parameters.
> > >
> > > public bool PrintReport(string reportPath, ParameterValue[]
> > > reportParameters, string printer)
> > >
> > > In VB, I am calling the function like this:
> > > PrintServer.PrintReport(ReportURL, ReportParameters, Printer)
> > >
> > > Here is how I have declared the ReportParameters object:
> > > Private ReportParameters(4) as ParameterValue
> > >
> > > Can someone please explain to me the error message and how to fix it?
> > >
> > >
> >
> >
> >|||Actually, I think that is what I need. I will take what you gave me and try
it. If it does not work, I will add another post. Thanks for explaining it
further.
"TIM ELLISON" wrote:
> Your web reference is going to create a namespace inside which the proxy for
> the web service resides. I'm assuming from your code that it's
> "SQLPrintServer.localhost".
> You also have a test application whose default namespace appears to be
> "TestApp".
> A fully qualified name for a class is "NameSpace.ClassName". Therefore,
> "SQLPrintServer.localhost.Parameter" is not equivalent to
> "TestApp.Parameter".
> Can you provide the code please? That might help.
> --
> Regards,
> Tim Ellison, MCP
> Ironworks Consulting, LLC
> (m) 804.405.4874
> "Mike Collins" <MikeCollins@.discussions.microsoft.com> wrote in message
> news:B1D28046-E92D-4336-8B1E-AD826C084505@.microsoft.com...
> > Thanks for the response Tim, but I am not sure what you mean by declcaring
> > ParameterValue[] parameter with the same namespance as that of the cSharp
> > library.
> >
> > I tried what I believe you were saying in my VB declaration:
> > Private ReportParameters(4) as SQLPrintServer.localhost.ParameterValue,
> with
> > SQLPrintServer being the namespace of my cSharp library, and got the same
> > error message.
> >
> > TestApp.vb(570): Value of type '1-dimensional array of
> > SQLPrintServer.localhost.ParameterValue' cannot be converted to
> > '1-dimensional array of TestApp.ParameterValue' because
> > 'SQLPrintServer.localhost.ParameterValue' is not derived from
> > 'TestApp.ParameterValue'.
> >
> > "TIM ELLISON" wrote:
> >
> > > Hi. Try fully declaring your ParameterValue[] parameter with the same
> > > namespace as that of the cSharp library.
> > >
> > >
> > > --
> > > Regards,
> > >
> > > Tim Ellison, MCP
> > > Ironworks Consulting, LLC
> > > (m) 804.405.4874
> > > "Mike Collins" <MikeCollins@.discussions.microsoft.com> wrote in message
> > > news:2DF92759-B44A-4D8B-A2D5-028EE17FF7FB@.microsoft.com...
> > > > I am attempting to use VB.Net to interface to a CSharp DLL to print
> > > reports.
> > > > I have taken the CSharp Example that I have seen reported in this
> > > newsgroup
> > > > and made it into a DLL. I am trying to use the Reporting Services
> report
> > > > parameter and getting the following error in VB.Net:
> > > >
> > > > TestApp.vb(613): Value of type '1-dimensional array of
> > > > TestApp.ParameterValue' cannot be converted to '1-dimensional array of
> > > > ParameterValue' because 'TestApp.ParameterValue' is not derived from
> > > > 'ParameterValue'.
> > > >
> > > > In the public function in the CSharp DLL, I am looking for three
> > > parameters.
> > > >
> > > > public bool PrintReport(string reportPath, ParameterValue[]
> > > > reportParameters, string printer)
> > > >
> > > > In VB, I am calling the function like this:
> > > > PrintServer.PrintReport(ReportURL, ReportParameters, Printer)
> > > >
> > > > Here is how I have declared the ReportParameters object:
> > > > Private ReportParameters(4) as ParameterValue
> > > >
> > > > Can someone please explain to me the error message and how to fix it?
> > > >
> > > >
> > >
> > >
> > >
>
>
Sunday, February 19, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment