Tuesday, March 27, 2012

DPE parameters

I'm creating a DPE to accept a serialized dataset as input to my
report at runtime. But I can't get the parameters working correctly
in VB. I assume the reporting service has some mechanism to set the
parameters, but what is it?
I have the readonly property Parameters that implements
IDbCommand.Parameters. But, it's readonly. So how does the property
get a value to start with?
ThanksIf the extension implements the required interfaces, RS will call the
parameter collection (IDataParameterCollection) Add method automatically
when the report is processed. As a prerequisite, the parameter has to be
declared as a query-level parameter. If it is only report-level param, it
won't be passed.
The sample data extension that comes with RS should get you started. I would
suggest you debug the extension to learn how it works. The easiest way to do
this is to add the extension to your RS solution.
Accidentally, I implemented a custom data extension to support reporting of
serialized or saved to files ADO.NET datasets that you may find useful.
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Steven" <montgoss@.hotmail.com> wrote in message
news:a73f4c07.0408060918.60dc6eb4@.posting.google.com...
> I'm creating a DPE to accept a serialized dataset as input to my
> report at runtime. But I can't get the parameters working correctly
> in VB. I assume the reporting service has some mechanism to set the
> parameters, but what is it?
> I have the readonly property Parameters that implements
> IDbCommand.Parameters. But, it's readonly. So how does the property
> get a value to start with?
> Thanks|||"Teo Lachev" <teo@.nospam.prologika.com> wrote in message news:<eh9vH1#eEHA.3428@.TK2MSFTNGP11.phx.gbl>...
> As a prerequisite, the parameter has to be
> declared as a query-level parameter. If it is only report-level param, it
> won't be passed.
I want to make sure I understand this. This means that I can't simply
define the parameter in the report designer. I have to also define it
in my DPE? And I do this via the IDbCommandAnalysis.GetParameters
implementation? Or is that simply for prompting the user at design
time for parameter?
Thx.|||Steven,
Please find my comments inline?
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Steven" <montgoss@.hotmail.com> wrote in message
news:a73f4c07.0408090515.8688bff@.posting.google.com...
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:<eh9vH1#eEHA.3428@.TK2MSFTNGP11.phx.gbl>...
> > As a prerequisite, the parameter has to be
> > declared as a query-level parameter. If it is only report-level param,
it
> > won't be passed.
> I want to make sure I understand this. This means that I can't simply
> define the parameter in the report designer.
Teo: No, what I was saying is that the parameter has to be defined as a
query (dataset)-level perameter in order to be passed to the custom database
extension. Just defining a parameter as a report-level parameter (Reports
menu->Parameters) is not enough.
I have to also define it
> in my DPE?
Teo: You don't define your parameters in the custom database extension.
Instead, RS (report designer during design time, Report Server during
runtime) will pass them to your extension.
And I do this via the IDbCommandAnalysis.GetParameters
> implementation? Or is that simply for prompting the user at design
> time for parameter?
Teo: Yes, IDbCommandAnalysis is optional and it is useful only during design
time to prompt the report author for parameters. For example, if you may use
a query statement like this:
select * from ... where given_column = @.some_value
In IDbCommandAnalysis.GetParameters you can parse the query statement,
discover that it contains a parameter called some_value and create a new
parameters collection and pass it back. The Report Designer then will
display the parameter collection.
> Thx.|||Thanks for your help so far.
Do you know why your sample doesn't automatically populate the fields
toolbox with values like the FSI sample does?|||Steven,
It should. Moreover, if the dataset has an XML Schema included, the custom
dataset extension should also expose the type of the fields. Did you look at
the readme file accompanying the extension for configuration instructions?
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Steven" <montgoss@.hotmail.com> wrote in message
news:a73f4c07.0408091207.2613bc07@.posting.google.com...
> Thanks for your help so far.
> Do you know why your sample doesn't automatically populate the fields
> toolbox with values like the FSI sample does?|||Yes, I looked at the readme. I get to the point after executing the
query where it says the fields box should now be populated, and it
isn't... This is something my DPE did automatically, but I don't see
how it did it or why yours doesn't seem to.
Just now, I clicked the "..." next to the dataset list and I got an
error. "Could not generate a list of fields for the query. Check the
query syntax or click Refresh Fields on the query toolbar. The path is
not of a legal form". Sure enough, after I clicked "Refresh Fields",
it populated the fields box. Any idea why it doesn't refresh fields
automatically? It seems like the illegal path is a reference to the
@.DataSource param which wasn't yet set(since I hadn't executed the
query).
Thanks.
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message news:<#wNp8AlfEHA.2764@.TK2MSFTNGP11.phx.gbl>...
> Steven,
> It should. Moreover, if the dataset has an XML Schema included, the custom
> dataset extension should also expose the type of the fields. Did you look at
> the readme file accompanying the extension for configuration instructions?
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com
>
> "Steven" <montgoss@.hotmail.com> wrote in message
> news:a73f4c07.0408091207.2613bc07@.posting.google.com...
> > Thanks for your help so far.
> >
> > Do you know why your sample doesn't automatically populate the fields
> > toolbox with values like the FSI sample does?|||Do you specify Nothing as a query text or the ADO.NET table name?
If yes, please send me your serialized ADO.NET dataset (remove nospam from
my e-mail address). I will be happy to look at it.
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Steven" <montgoss@.hotmail.com> wrote in message
news:a73f4c07.0408100558.50830c01@.posting.google.com...
> Yes, I looked at the readme. I get to the point after executing the
> query where it says the fields box should now be populated, and it
> isn't... This is something my DPE did automatically, but I don't see
> how it did it or why yours doesn't seem to.
> Just now, I clicked the "..." next to the dataset list and I got an
> error. "Could not generate a list of fields for the query. Check the
> query syntax or click Refresh Fields on the query toolbar. The path is
> not of a legal form". Sure enough, after I clicked "Refresh Fields",
> it populated the fields box. Any idea why it doesn't refresh fields
> automatically? It seems like the illegal path is a reference to the
> @.DataSource param which wasn't yet set(since I hadn't executed the
> query).
> Thanks.
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:<#wNp8AlfEHA.2764@.TK2MSFTNGP11.phx.gbl>...
> > Steven,
> >
> > It should. Moreover, if the dataset has an XML Schema included, the
custom
> > dataset extension should also expose the type of the fields. Did you
look at
> > the readme file accompanying the extension for configuration
instructions?
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > http://www.prologika.com
> >
> >
> > "Steven" <montgoss@.hotmail.com> wrote in message
> > news:a73f4c07.0408091207.2613bc07@.posting.google.com...
> > > Thanks for your help so far.
> > >
> > > Do you know why your sample doesn't automatically populate the fields
> > > toolbox with values like the FSI sample does?|||Yes, I was using "Nothing". I also tried "SalesOrderHeader" with the
same result. I'm using the EntitySalesOrder.xsd from your sample when
doing this.(I assume I don't need to send that to you)
Is it maybe some configuration error on my machine?
Thanks,
Steven
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message news:<ukBywqufEHA.904@.TK2MSFTNGP09.phx.gbl>...
> Do you specify Nothing as a query text or the ADO.NET table name?
> If yes, please send me your serialized ADO.NET dataset (remove nospam from
> my e-mail address). I will be happy to look at it.
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com|||So, when you run the query in the Generic Query Designer what columns do you
see in the results grid?
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Steven" <montgoss@.hotmail.com> wrote in message
news:a73f4c07.0408110902.4a0007c3@.posting.google.com...
> Yes, I was using "Nothing". I also tried "SalesOrderHeader" with the
> same result. I'm using the EntitySalesOrder.xsd from your sample when
> doing this.(I assume I don't need to send that to you)
> Is it maybe some configuration error on my machine?
> Thanks,
> Steven
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:<ukBywqufEHA.904@.TK2MSFTNGP09.phx.gbl>...
> > Do you specify Nothing as a query text or the ADO.NET table name?
> >
> > If yes, please send me your serialized ADO.NET dataset (remove nospam
from
> > my e-mail address). I will be happy to look at it.
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > http://www.prologika.com|||SalesOrderID, CustomerID, PurchaseOrderNumber and OrderDate.
Steven
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message news:<uL2dV18fEHA.2984@.tk2msftngp13.phx.gbl>...
> So, when you run the query in the Generic Query Designer what columns do you
> see in the results grid?
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com|||When you click the Refresh Fields button on the Data tab toolbar do you see
the same fields?
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Steven" <montgoss@.hotmail.com> wrote in message
news:a73f4c07.0408120920.70ea1d42@.posting.google.com...
> SalesOrderID, CustomerID, PurchaseOrderNumber and OrderDate.
> Steven
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
news:<uL2dV18fEHA.2984@.tk2msftngp13.phx.gbl>...
> > So, when you run the query in the Generic Query Designer what columns do
you
> > see in the results grid?
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > http://www.prologika.com|||Yes, and then they also show up in the fields box.
"Teo Lachev" <teo@.nospam.prologika.com> wrote in message news:<OTdWdVJgEHA.3964@.TK2MSFTNGP12.phx.gbl>...
> When you click the Refresh Fields button on the Data tab toolbar do you see
> the same fields?
> --
> Hope this helps.
> ---
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> http://www.prologika.com
>
> "Steven" <montgoss@.hotmail.com> wrote in message
> news:a73f4c07.0408120920.70ea1d42@.posting.google.com...
> > SalesOrderID, CustomerID, PurchaseOrderNumber and OrderDate.
> >
> > Steven
> >
> > "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
> news:<uL2dV18fEHA.2984@.tk2msftngp13.phx.gbl>...
> > > So, when you run the query in the Generic Query Designer what columns do
> you
> > > see in the results grid?
> > >
> > > --
> > > Hope this helps.
> > >
> > > ---
> > > Teo Lachev, MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > http://www.prologika.com|||I get the same behavior with my custom DPE. I have an ADO.net dataset. The
designer shows the columns, but the fields list is empty until I click the
refresh fields button. My dataset is named "NewDataSet" and my table is
named "ResultTable". Is the table name supposed to be set to Nothing?
Was there resolution to this thread?
-David
"Steven" wrote:
> Yes, and then they also show up in the fields box.
> "Teo Lachev" <teo@.nospam.prologika.com> wrote in message news:<OTdWdVJgEHA.3964@.TK2MSFTNGP12.phx.gbl>...
> > When you click the Refresh Fields button on the Data tab toolbar do you see
> > the same fields?
> >
> > --
> > Hope this helps.
> >
> > ---
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > http://www.prologika.com
> >
> >
> > "Steven" <montgoss@.hotmail.com> wrote in message
> > news:a73f4c07.0408120920.70ea1d42@.posting.google.com...
> > > SalesOrderID, CustomerID, PurchaseOrderNumber and OrderDate.
> > >
> > > Steven
> > >
> > > "Teo Lachev" <teo@.nospam.prologika.com> wrote in message
> > news:<uL2dV18fEHA.2984@.tk2msftngp13.phx.gbl>...
> > > > So, when you run the query in the Generic Query Designer what columns do
> > you
> > > > see in the results grid?
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ---
> > > > Teo Lachev, MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > http://www.prologika.com
>

No comments:

Post a Comment