Saturday, February 25, 2012

Custom Data Extension problems

Hi all,
I'm trying to develop a custom data extension for a proprietary database we
use, and I'm running into problems. I've built a test harness for it and it
works fine; however when I try to use it with RS I get the following error
just after having entered my query and pressed Next in the New Report wizard:
"An error occurred while the query design method was being saved. Object
reference not set to an instance of an object"
When I step through my code, I can see that everything goes well until the
designer tries to call the Parameters property on the Command object. Because
my database doesn't support parameters I'm returning null here, something
I've seen in several code examples. As soon as I've exited the property I get
the error, with the debugger saying it originates from
Microsoft.ReportDesigner.Design.Query.HasParameters.
Other background information (in no particular order):
- Before I get to the Parameters property, I see that the GetName and
GetFieldType properties on my DataReader are called the same number of times
as there are columns in my resultset, and then the Dispose method is called
on the DataReader.
- My queries are in XML, and here's the sample I'm using for testing:
<DVAutoXMLFetch Database="C:\Program Files\IMS Health\DATA\DBPINT01.PRM">
<TimePeriods Count="4">
<TimePeriod>QTR/3/02</TimePeriod>
</TimePeriods>
<Variables Count="3">
<Variable>UN</Variable>
</Variables>
<Dimensions Count="16">
<Dimension Name="CTY" IsGroup="False" BaseDim="">
<Member>AUSTRIA</Member>
</Dimension>
</Dimensions>
<FetchDefinition>
<NumberPrecision ValColNumPrec="1000" ValColRndPrec="1" CalcColRndPrec="3"
/>
<AcrossMeasures Count="2">
<AcrossMeasure Index="1" DimName="TimePeriods" />
<AcrossMeasure Index="2" DimName="Variables" />
<Columns Count="1" Rank="0" CalcRank="0" />
</AcrossMeasures>
<DownMeasures Count="1">
<DownMeasure Index="1" DimName="CTY" />
</DownMeasures>
</FetchDefinition>
</DVAutoXMLFetch>
- I'm running RS SP1 on Windows 2000.
- I can post the source code if anyone wants...
Thanks in advance for any hints!
ChrisChris,
Don't return null. Instead, instantiate your ParameterCollection and return
it back although it will be emply.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
news:7373D28A-BDDA-450B-B1DC-53605BF8C821@.microsoft.com...
> Hi all,
> I'm trying to develop a custom data extension for a proprietary database
we
> use, and I'm running into problems. I've built a test harness for it and
it
> works fine; however when I try to use it with RS I get the following error
> just after having entered my query and pressed Next in the New Report
wizard:
> "An error occurred while the query design method was being saved. Object
> reference not set to an instance of an object"
> When I step through my code, I can see that everything goes well until the
> designer tries to call the Parameters property on the Command object.
Because
> my database doesn't support parameters I'm returning null here, something
> I've seen in several code examples. As soon as I've exited the property I
get
> the error, with the debugger saying it originates from
> Microsoft.ReportDesigner.Design.Query.HasParameters.
> Other background information (in no particular order):
> - Before I get to the Parameters property, I see that the GetName and
> GetFieldType properties on my DataReader are called the same number of
times
> as there are columns in my resultset, and then the Dispose method is
called
> on the DataReader.
> - My queries are in XML, and here's the sample I'm using for testing:
> <DVAutoXMLFetch Database="C:\Program Files\IMS Health\DATA\DBPINT01.PRM">
> <TimePeriods Count="4">
> <TimePeriod>QTR/3/02</TimePeriod>
> </TimePeriods>
> <Variables Count="3">
> <Variable>UN</Variable>
> </Variables>
> <Dimensions Count="16">
> <Dimension Name="CTY" IsGroup="False" BaseDim="">
> <Member>AUSTRIA</Member>
> </Dimension>
> </Dimensions>
> <FetchDefinition>
> <NumberPrecision ValColNumPrec="1000" ValColRndPrec="1"
CalcColRndPrec="3"
> />
> <AcrossMeasures Count="2">
> <AcrossMeasure Index="1" DimName="TimePeriods" />
> <AcrossMeasure Index="2" DimName="Variables" />
> <Columns Count="1" Rank="0" CalcRank="0" />
> </AcrossMeasures>
> <DownMeasures Count="1">
> <DownMeasure Index="1" DimName="CTY" />
> </DownMeasures>
> </FetchDefinition>
> </DVAutoXMLFetch>
> - I'm running RS SP1 on Windows 2000.
> - I can post the source code if anyone wants...
> Thanks in advance for any hints!
> Chris
>|||Hi Teo,
Thanks, that solved that problem. I've seen several code examples which
returned null for Parameters, which presumably must have worked at some
point; has the behaviour changed since beta 1?
Anyway, I have a new problem now - the report wizard almost, but I get a COM
Interop exception when I click Finish. The error originates from
Microsoft.DataWarehouse.VsIntegration.Designer.Serialization.DataWarehouseContainerManager.CreateDocumentObjectDictionary.
Once again the error is raised from outside my code. Any more ideas?
Thanks again,
Chris
"Teo Lachev" wrote:
> Chris,
> Don't return null. Instead, instantiate your ParameterCollection and return
> it back although it will be emply.
> --
> Hope this helps.
> ----
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ----
> "Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
> news:7373D28A-BDDA-450B-B1DC-53605BF8C821@.microsoft.com...
> > Hi all,
> >
> > I'm trying to develop a custom data extension for a proprietary database
> we
> > use, and I'm running into problems. I've built a test harness for it and
> it
> > works fine; however when I try to use it with RS I get the following error
> > just after having entered my query and pressed Next in the New Report
> wizard:
> > "An error occurred while the query design method was being saved. Object
> > reference not set to an instance of an object"
> >
> > When I step through my code, I can see that everything goes well until the
> > designer tries to call the Parameters property on the Command object.
> Because
> > my database doesn't support parameters I'm returning null here, something
> > I've seen in several code examples. As soon as I've exited the property I
> get
> > the error, with the debugger saying it originates from
> > Microsoft.ReportDesigner.Design.Query.HasParameters.
> >
> > Other background information (in no particular order):
> > - Before I get to the Parameters property, I see that the GetName and
> > GetFieldType properties on my DataReader are called the same number of
> times
> > as there are columns in my resultset, and then the Dispose method is
> called
> > on the DataReader.
> > - My queries are in XML, and here's the sample I'm using for testing:
> > <DVAutoXMLFetch Database="C:\Program Files\IMS Health\DATA\DBPINT01.PRM">
> > <TimePeriods Count="4">
> > <TimePeriod>QTR/3/02</TimePeriod>
> > </TimePeriods>
> > <Variables Count="3">
> > <Variable>UN</Variable>
> > </Variables>
> > <Dimensions Count="16">
> > <Dimension Name="CTY" IsGroup="False" BaseDim="">
> > <Member>AUSTRIA</Member>
> > </Dimension>
> > </Dimensions>
> > <FetchDefinition>
> > <NumberPrecision ValColNumPrec="1000" ValColRndPrec="1"
> CalcColRndPrec="3"
> > />
> > <AcrossMeasures Count="2">
> > <AcrossMeasure Index="1" DimName="TimePeriods" />
> > <AcrossMeasure Index="2" DimName="Variables" />
> > <Columns Count="1" Rank="0" CalcRank="0" />
> > </AcrossMeasures>
> > <DownMeasures Count="1">
> > <DownMeasure Index="1" DimName="CTY" />
> > </DownMeasures>
> > </FetchDefinition>
> > </DVAutoXMLFetch>
> > - I'm running RS SP1 on Windows 2000.
> > - I can post the source code if anyone wants...
> >
> > Thanks in advance for any hints!
> >
> > Chris
> >
>
>|||Chris,
Not from the top of my head. Could you put breakpoints in all public methods
and see after which call the exception is thrown. There must be something
quirky in the data extension itself.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
news:987083A9-8CE5-4A99-A887-A32247FB8776@.microsoft.com...
> Hi Teo,
> Thanks, that solved that problem. I've seen several code examples which
> returned null for Parameters, which presumably must have worked at some
> point; has the behaviour changed since beta 1?
> Anyway, I have a new problem now - the report wizard almost, but I get a
COM
> Interop exception when I click Finish. The error originates from
>
Microsoft.DataWarehouse.VsIntegration.Designer.Serialization.DataWarehouseCo
ntainerManager.CreateDocumentObjectDictionary.
> Once again the error is raised from outside my code. Any more ideas?
> Thanks again,
> Chris
> "Teo Lachev" wrote:
> > Chris,
> >
> > Don't return null. Instead, instantiate your ParameterCollection and
return
> > it back although it will be emply.
> >
> > --
> > Hope this helps.
> >
> > ----
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ----
> >
> > "Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
> > news:7373D28A-BDDA-450B-B1DC-53605BF8C821@.microsoft.com...
> > > Hi all,
> > >
> > > I'm trying to develop a custom data extension for a proprietary
database
> > we
> > > use, and I'm running into problems. I've built a test harness for it
and
> > it
> > > works fine; however when I try to use it with RS I get the following
error
> > > just after having entered my query and pressed Next in the New Report
> > wizard:
> > > "An error occurred while the query design method was being saved.
Object
> > > reference not set to an instance of an object"
> > >
> > > When I step through my code, I can see that everything goes well until
the
> > > designer tries to call the Parameters property on the Command object.
> > Because
> > > my database doesn't support parameters I'm returning null here,
something
> > > I've seen in several code examples. As soon as I've exited the
property I
> > get
> > > the error, with the debugger saying it originates from
> > > Microsoft.ReportDesigner.Design.Query.HasParameters.
> > >
> > > Other background information (in no particular order):
> > > - Before I get to the Parameters property, I see that the GetName and
> > > GetFieldType properties on my DataReader are called the same number of
> > times
> > > as there are columns in my resultset, and then the Dispose method is
> > called
> > > on the DataReader.
> > > - My queries are in XML, and here's the sample I'm using for testing:
> > > <DVAutoXMLFetch Database="C:\Program Files\IMS
Health\DATA\DBPINT01.PRM">
> > > <TimePeriods Count="4">
> > > <TimePeriod>QTR/3/02</TimePeriod>
> > > </TimePeriods>
> > > <Variables Count="3">
> > > <Variable>UN</Variable>
> > > </Variables>
> > > <Dimensions Count="16">
> > > <Dimension Name="CTY" IsGroup="False" BaseDim="">
> > > <Member>AUSTRIA</Member>
> > > </Dimension>
> > > </Dimensions>
> > > <FetchDefinition>
> > > <NumberPrecision ValColNumPrec="1000" ValColRndPrec="1"
> > CalcColRndPrec="3"
> > > />
> > > <AcrossMeasures Count="2">
> > > <AcrossMeasure Index="1" DimName="TimePeriods" />
> > > <AcrossMeasure Index="2" DimName="Variables" />
> > > <Columns Count="1" Rank="0" CalcRank="0" />
> > > </AcrossMeasures>
> > > <DownMeasures Count="1">
> > > <DownMeasure Index="1" DimName="CTY" />
> > > </DownMeasures>
> > > </FetchDefinition>
> > > </DVAutoXMLFetch>
> > > - I'm running RS SP1 on Windows 2000.
> > > - I can post the source code if anyone wants...
> > >
> > > Thanks in advance for any hints!
> > >
> > > Chris
> > >
> >
> >
> >|||Teo,
I did that and still had no luck - and then saw the bug by accident and
fixed it. Everything now seems to run fine, but it did make me wonder - I was
debugging the devenv.exe process, but when you run a report in preview
(rather than build it) does it spawn a new process? That might explain my
problems debugging it, no?
Thanks for all your help,
Chris
"Teo Lachev" wrote:
> Chris,
> Not from the top of my head. Could you put breakpoints in all public methods
> and see after which call the exception is thrown. There must be something
> quirky in the data extension itself.
> --
> Hope this helps.
> ----
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ----
> "Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
> news:987083A9-8CE5-4A99-A887-A32247FB8776@.microsoft.com...
> > Hi Teo,
> >
> > Thanks, that solved that problem. I've seen several code examples which
> > returned null for Parameters, which presumably must have worked at some
> > point; has the behaviour changed since beta 1?
> >
> > Anyway, I have a new problem now - the report wizard almost, but I get a
> COM
> > Interop exception when I click Finish. The error originates from
> >
> Microsoft.DataWarehouse.VsIntegration.Designer.Serialization.DataWarehouseCo
> ntainerManager.CreateDocumentObjectDictionary.
> > Once again the error is raised from outside my code. Any more ideas?
> >
> > Thanks again,
> >
> > Chris
> >
> > "Teo Lachev" wrote:
> >
> > > Chris,
> > >
> > > Don't return null. Instead, instantiate your ParameterCollection and
> return
> > > it back although it will be emply.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ----
> > > Teo Lachev, MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > Home page and blog: http://www.prologika.com/
> > > ----
> > >
> > > "Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
> > > news:7373D28A-BDDA-450B-B1DC-53605BF8C821@.microsoft.com...
> > > > Hi all,
> > > >
> > > > I'm trying to develop a custom data extension for a proprietary
> database
> > > we
> > > > use, and I'm running into problems. I've built a test harness for it
> and
> > > it
> > > > works fine; however when I try to use it with RS I get the following
> error
> > > > just after having entered my query and pressed Next in the New Report
> > > wizard:
> > > > "An error occurred while the query design method was being saved.
> Object
> > > > reference not set to an instance of an object"
> > > >
> > > > When I step through my code, I can see that everything goes well until
> the
> > > > designer tries to call the Parameters property on the Command object.
> > > Because
> > > > my database doesn't support parameters I'm returning null here,
> something
> > > > I've seen in several code examples. As soon as I've exited the
> property I
> > > get
> > > > the error, with the debugger saying it originates from
> > > > Microsoft.ReportDesigner.Design.Query.HasParameters.
> > > >
> > > > Other background information (in no particular order):
> > > > - Before I get to the Parameters property, I see that the GetName and
> > > > GetFieldType properties on my DataReader are called the same number of
> > > times
> > > > as there are columns in my resultset, and then the Dispose method is
> > > called
> > > > on the DataReader.
> > > > - My queries are in XML, and here's the sample I'm using for testing:
> > > > <DVAutoXMLFetch Database="C:\Program Files\IMS
> Health\DATA\DBPINT01.PRM">
> > > > <TimePeriods Count="4">
> > > > <TimePeriod>QTR/3/02</TimePeriod>
> > > > </TimePeriods>
> > > > <Variables Count="3">
> > > > <Variable>UN</Variable>
> > > > </Variables>
> > > > <Dimensions Count="16">
> > > > <Dimension Name="CTY" IsGroup="False" BaseDim="">
> > > > <Member>AUSTRIA</Member>
> > > > </Dimension>
> > > > </Dimensions>
> > > > <FetchDefinition>
> > > > <NumberPrecision ValColNumPrec="1000" ValColRndPrec="1"
> > > CalcColRndPrec="3"
> > > > />
> > > > <AcrossMeasures Count="2">
> > > > <AcrossMeasure Index="1" DimName="TimePeriods" />
> > > > <AcrossMeasure Index="2" DimName="Variables" />
> > > > <Columns Count="1" Rank="0" CalcRank="0" />
> > > > </AcrossMeasures>
> > > > <DownMeasures Count="1">
> > > > <DownMeasure Index="1" DimName="CTY" />
> > > > </DownMeasures>
> > > > </FetchDefinition>
> > > > </DVAutoXMLFetch>
> > > > - I'm running RS SP1 on Windows 2000.
> > > > - I can post the source code if anyone wants...
> > > >
> > > > Thanks in advance for any hints!
> > > >
> > > > Chris
> > > >
> > >
> > >
> > >
>
>|||It may be if the issue was security related. The idea behind the ReportHost
(F5), is to allow the report author to simulate the Report Server
(production) environment by applying the security settings from the
rspreviewpolicy.config.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
news:44823615-9F6C-4477-A3DD-ECDCF43BE81A@.microsoft.com...
> Teo,
> I did that and still had no luck - and then saw the bug by accident and
> fixed it. Everything now seems to run fine, but it did make me wonder - I
was
> debugging the devenv.exe process, but when you run a report in preview
> (rather than build it) does it spawn a new process? That might explain my
> problems debugging it, no?
> Thanks for all your help,
> Chris
> "Teo Lachev" wrote:
> > Chris,
> >
> > Not from the top of my head. Could you put breakpoints in all public
methods
> > and see after which call the exception is thrown. There must be
something
> > quirky in the data extension itself.
> >
> > --
> > Hope this helps.
> >
> > ----
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ----
> >
> > "Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in message
> > news:987083A9-8CE5-4A99-A887-A32247FB8776@.microsoft.com...
> > > Hi Teo,
> > >
> > > Thanks, that solved that problem. I've seen several code examples
which
> > > returned null for Parameters, which presumably must have worked at
some
> > > point; has the behaviour changed since beta 1?
> > >
> > > Anyway, I have a new problem now - the report wizard almost, but I get
a
> > COM
> > > Interop exception when I click Finish. The error originates from
> > >
> >
Microsoft.DataWarehouse.VsIntegration.Designer.Serialization.DataWarehouseCo
> > ntainerManager.CreateDocumentObjectDictionary.
> > > Once again the error is raised from outside my code. Any more ideas?
> > >
> > > Thanks again,
> > >
> > > Chris
> > >
> > > "Teo Lachev" wrote:
> > >
> > > > Chris,
> > > >
> > > > Don't return null. Instead, instantiate your ParameterCollection and
> > return
> > > > it back although it will be emply.
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ----
> > > > Teo Lachev, MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com: http://shrinkster.com/eq
> > > > Home page and blog: http://www.prologika.com/
> > > > ----
> > > >
> > > > "Chris Webb" <OnlyForPostingToNewsgroups@.hotmail.com> wrote in
message
> > > > news:7373D28A-BDDA-450B-B1DC-53605BF8C821@.microsoft.com...
> > > > > Hi all,
> > > > >
> > > > > I'm trying to develop a custom data extension for a proprietary
> > database
> > > > we
> > > > > use, and I'm running into problems. I've built a test harness for
it
> > and
> > > > it
> > > > > works fine; however when I try to use it with RS I get the
following
> > error
> > > > > just after having entered my query and pressed Next in the New
Report
> > > > wizard:
> > > > > "An error occurred while the query design method was being saved.
> > Object
> > > > > reference not set to an instance of an object"
> > > > >
> > > > > When I step through my code, I can see that everything goes well
until
> > the
> > > > > designer tries to call the Parameters property on the Command
object.
> > > > Because
> > > > > my database doesn't support parameters I'm returning null here,
> > something
> > > > > I've seen in several code examples. As soon as I've exited the
> > property I
> > > > get
> > > > > the error, with the debugger saying it originates from
> > > > > Microsoft.ReportDesigner.Design.Query.HasParameters.
> > > > >
> > > > > Other background information (in no particular order):
> > > > > - Before I get to the Parameters property, I see that the GetName
and
> > > > > GetFieldType properties on my DataReader are called the same
number of
> > > > times
> > > > > as there are columns in my resultset, and then the Dispose method
is
> > > > called
> > > > > on the DataReader.
> > > > > - My queries are in XML, and here's the sample I'm using for
testing:
> > > > > <DVAutoXMLFetch Database="C:\Program Files\IMS
> > Health\DATA\DBPINT01.PRM">
> > > > > <TimePeriods Count="4">
> > > > > <TimePeriod>QTR/3/02</TimePeriod>
> > > > > </TimePeriods>
> > > > > <Variables Count="3">
> > > > > <Variable>UN</Variable>
> > > > > </Variables>
> > > > > <Dimensions Count="16">
> > > > > <Dimension Name="CTY" IsGroup="False" BaseDim="">
> > > > > <Member>AUSTRIA</Member>
> > > > > </Dimension>
> > > > > </Dimensions>
> > > > > <FetchDefinition>
> > > > > <NumberPrecision ValColNumPrec="1000" ValColRndPrec="1"
> > > > CalcColRndPrec="3"
> > > > > />
> > > > > <AcrossMeasures Count="2">
> > > > > <AcrossMeasure Index="1" DimName="TimePeriods" />
> > > > > <AcrossMeasure Index="2" DimName="Variables" />
> > > > > <Columns Count="1" Rank="0" CalcRank="0" />
> > > > > </AcrossMeasures>
> > > > > <DownMeasures Count="1">
> > > > > <DownMeasure Index="1" DimName="CTY" />
> > > > > </DownMeasures>
> > > > > </FetchDefinition>
> > > > > </DVAutoXMLFetch>
> > > > > - I'm running RS SP1 on Windows 2000.
> > > > > - I can post the source code if anyone wants...
> > > > >
> > > > > Thanks in advance for any hints!
> > > > >
> > > > > Chris
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||Using Custom data Extensions , i am able to pass a dataset to my report. All goes fine as long as i dont need a parameter to pass to my stored procedure which i execute from my CDE. But i now need to pass a parameter to it for it to return a dataset.Please help.I have spend lots of time over this but have not yet goy the soluion
From http://www.developmentnow.com/g/115_2004_9_0_0_450456/Custom-Data-Extension-problems.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com

No comments:

Post a Comment