Showing posts with label parameters. Show all posts
Showing posts with label parameters. Show all posts

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
>

Wednesday, March 7, 2012

don't prompt user for parameters error

I am trying to run a report in RS using url parameters. I want to prompt the
user for two parameters, but I want to hide the other six parameters (the
values are set in the url and the user should not be able to change them).
When I am in RS in Properties and Parameters I can set each parameter to
prompt user or not prompt user. If I set any of them to not prompt user
(uncheck the checkbox) I get the following error:
The report parameter 'nodeID' is read-only and cannot be modified.
(rsReadOnlyReportParameter)
This error shows for the one parameter that is selected not to prompt, or
for the first one in the list if I set them all to not prompt.
What am I doing wrong? Is there some other way to hide these parameters?
Thank you for your help!
Sharlynleave the prompt in VS.net, deploy and change the properties in the report
manager. check "prompt user" but leave the string blank.
"SharinDenver" wrote:
> I am trying to run a report in RS using url parameters. I want to prompt the
> user for two parameters, but I want to hide the other six parameters (the
> values are set in the url and the user should not be able to change them).
> When I am in RS in Properties and Parameters I can set each parameter to
> prompt user or not prompt user. If I set any of them to not prompt user
> (uncheck the checkbox) I get the following error:
> The report parameter 'nodeID' is read-only and cannot be modified.
> (rsReadOnlyReportParameter)
> This error shows for the one parameter that is selected not to prompt, or
> for the first one in the list if I set them all to not prompt.
> What am I doing wrong? Is there some other way to hide these parameters?
> Thank you for your help!
> Sharlyn
>

Sunday, February 26, 2012

Don't Auto Run with default parameters

Is there a way to not have a report run when all of the default parameters
are set?
We would like to give the users some defaults so they don't have to type as
much when they run a report.Unfortunately there is not. There have been many request for this feature.
If you can wait for Yukon then you could use the viewer control which you
could give this behavior.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Alec Hardy" <AlecHardy@.discussions.microsoft.com> wrote in message
news:B3C08BBF-2D07-4941-A986-BA89E122E346@.microsoft.com...
> Is there a way to not have a report run when all of the default parameters
> are set?
> We would like to give the users some defaults so they don't have to type
> as
> much when they run a report.

Tuesday, February 14, 2012

does using sql parameters speed asp.net code up?

does using sql parameters speed asp.net code up?Depends on a lot of things. It's usually more secure than straight SQL code, which is what I'm assuming you're comparing this to. Also, if you are using stored procedures they are a bit speedier on the server side (but I don't know if you'd notice it, depends on the app).

But from a security perspective (to avoid SQL injection attacks), it's a good idea. IMHO|||I have a question about paramaters then.. I have only seen sample for INSERT how about UPDATE AND DELETE?

Here is my insert statement

SQL = "INSERT INTO table1(id, key_data) VALUES (@.ID, @.key)"

conn = New SQLConnection(SQLserver)
dbComm2 = New SqlCommand(SQL,conn)
dbComm2.Parameters.Add(New SqlParameter("@.ID", Session("id")))
dbComm2.Parameters.Add(New SqlParameter("@.key", KeyGeN))

How would i change these for delete and Update?

thanks|||xactly the same...just change your query


update table set col=@.var1, col2=@.var2 where col3=@.var3

then add the variables and their values like you did above

same for delete also

hth