Showing posts with label events. Show all posts
Showing posts with label events. Show all posts

Wednesday, March 28, 2012

How to assign a value to a parameter?

Hello everyone,

i have the parameter in my stored procedure that i am using as a sqldatasource.

Now in one of the events, i need to assign a value to the parameter. How can i do that?

Microsoft is changing the syntax so often, all solutions i found on this forum just don't work anymore, like:

SqlDataSource1.SelectParameters[

"@.CompareInteger"].value="1"

OR

SqlDataSource1.SelectParameters["@.CompareInteger"].DefaultValue="1"

I guess the SelectParameter - became 'ReadOnly'..But how to assign value to a parameter now?!?

Thanks for any help

They aren't changing the syntax.. Hasn't ever changed, but those methods you mentioned above only work in certain circumstances, because they are "hacks".

What you want to do is capture the SqlDataSource1_Selecting event. From within that event, you have access to the underlying command (and parameters collection). Your code from within that event would looks something like:

e.Parameters["@.CompareInteger"].Value="1;

Or

e.parameters("@.compareinteger").value="1" if you are using VB.NET

|||

it does not work, Motley. It does not work.

for SqlDataSource1_Selecting event, e does not have such an option - e.parameters - check it for yourself...:(

So, the question still remains - HOW TO ASSIGN VALUE TO A PARAMETER?

|||IS there any way to assign the value to a parameter?!?!? in any event procedure?|||

If it's not e.parameters, then it's one of the following:

e.SelectCommand.Parameters

or

e.Command.Parameters

|||

thank you, Motley ! Will remember it now.

Wednesday, March 7, 2012

How to Add an event to CRI controls

Hi all,

I am trying to develop a CustomReportItem similar to Matrix control. Is it possible to add some "OnClick" sort of events to a section of this CRI (As a drilldown button of matrix control allows to expand the respective column).

Please help me if there can be any solution.

I think it not possible to do that.

Report is web page , is not the application window.

sort the date, you can add a sort report parameters,

different parameters, show different matrix.

|||

Are you asking about design time or runtime?

While the CRI runtime control can generate drillthrough actions based on an image map, currently you cannot fully simulate the matrix group toggle behavior. You would rather need to work around it with report drillthrough actions and encoding the toggle state in parameter values.

-- Robert

|||

Hi Robert,

Thanks for ur response

I am asking it for runtime. How can I encode the toggle state in parameter values and how will it help to solve my problem? Please explain, as I am new to this tool.

|||

For every toggle icon, you could use a boolean report parameter to encode its state (e.g. expanded = true, collapsed = false). Another option is to encode the state of multiple toggles into an integer parameter (by using it as a bitfield) or maybe as string parameter.

For the CRI runtime control you would need to pass the parameter values as custom property values so that you can see the current toggle state (i.e. report parameter values) from within your CRI runtime code. Then you would need to draw the toggle icons as part of the image generated by the CRI runtime control. In addition you need to generate an image map over the toggle icon with a drillthrough action that drills to the same report with a report parameter value that has the opposite value of the currently drawn toggle state.

For example, if there is only one toggle and the toggle icon drawn is shown as expanded (with a report parameter representation as =True), you would add an image map area with a drillthrough action that passes the report parameter with the boolean value =False.

-- Robert