Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Thursday, March 29, 2012

Changing the source wth a button

Hi,

I have this Gridview in which I show attendees to a course (per course)

In the same gridview I want to be able (by clicking a button) to show all attendees to all courses simply by leaving out a part of the SQL;

WHERE Eventid = @.eventid (resulting in all attendees no matter what course)

In other words how can I alter the selectcommand of the SQLDataSource?

Seems simple, but can't hack it.

Thanks in advance,

Lx

Hello my friend,

There are several ways to do this. A straightforward one would be to reserve a number to mean ALL of them, like so: -

SELECT * FROM MyTable WHERE (EventID = @.EventID OR @.EventID = -1)

Now just pass in -1 when you want to get all of them.

Kind regards

Scotty

|||

Hi,

Thank you,

The actual SQL is not a problem. I want to change the Selectcommand using a Commandbutton.

Lets say.

Clicking Button 1 results in the use of the Selectcommand: SELECT * FROM MyTable (resulting in all attendees no matter what course)

Clicking Button 2 results in the use of the Selectcommand: SELECT * FROM MyTableWHERE Eventid = @.eventid

Thanks in advance,

Lx

|||

Hi,

Turned out to be quite simple:

<Grid>.SelectCommand =

"SELECT Blahblah" in the code for the Button worked fine.

Lx

Tuesday, March 27, 2012

Changing the parameter of a Snapshot

I understand that a history can be created in Reporting Services. Is
it true that when you click on the "New Snapshot" button, you get a
report using the default parameter? If so, then the "history" feature
is pretty much useless as you can only generate one version of the
report. What we want is to be able to take snapshots of a report at a
give point in time with the desired parameters.
Thanks for any input here.Yes, snapshots in the history are taken with default values of parameters.
If you need to store snapshot with different parameter values, you need to
set different defaults and then take snapshot. Also, when you render that
snapshot, you can change values of parameters that are not used in query.
--
Dmitry Vasilevsky, SQL Server Reporting Services Developer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
---
"Eugene" <primer200@.yahoo.com> wrote in message
news:6290d6d2.0407281559.735524cb@.posting.google.com...
> I understand that a history can be created in Reporting Services. Is
> it true that when you click on the "New Snapshot" button, you get a
> report using the default parameter? If so, then the "history" feature
> is pretty much useless as you can only generate one version of the
> report. What we want is to be able to take snapshots of a report at a
> give point in time with the desired parameters.
> Thanks for any input here.|||Dmitry,
From a user point of view, I changed the parameter and I want to take
a snapshot of what I did. That would be a fair enough request,
wouldn't it? The administrator can't give a user Content Manager right
for him to change the default. May be this can be included in
enhencement for the next release?
Regards
Eugene|||We consider this as a request, however, it is not as straightforward as it
seems.
1. Snapshots were not intended to be a replacement for a good Data
Warehouse. Every missing feature about snapshots (and even snapshots
themselves) can be "worked around" by setting a data warehouse that can
reconstruct result of a query for any given time.
2. History is bound to a report, not to a user. Items in history don't carry
any individual security. Anyone who have access to a report would be able to
render from history. Therefore, personal preferences of a anyone, creating
snapshot would affect all users.
3. When allowing defaults only we identify snapshots by creation time. If we
accept parameters, we would have to introduce other means to identify and
manage snapshots. It would be possible and reasonable to take multiple
snapshots at the same time.
4. In many cases, users can create a linked report, provide different
default values for parameters and take snapshot of that linked report.
Dmitry Vasilevsky, SQL Server Reporting Services Developer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
---
"Eugene" <primer200@.yahoo.com> wrote in message
news:6290d6d2.0408012040.b062b04@.posting.google.com...
> Dmitry,
> From a user point of view, I changed the parameter and I want to take
> a snapshot of what I did. That would be a fair enough request,
> wouldn't it? The administrator can't give a user Content Manager right
> for him to change the default. May be this can be included in
> enhencement for the next release?
> Regards
> Eugene