This is a migrated thread and some comments may be shown as answers.

Passing Parameters to sql query

3 Answers 756 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Manuel
Top achievements
Rank 1
Manuel asked on 19 Dec 2011, 04:07 PM
Hi there,

How I can pass parameters to my sql queries in query builder. Please look at picture.

In my ReportViewer I do that:

 public SGASeguranca()
        {
            InitializeComponent();

            try
            {

                ReportViewer1.Report = "ReportClass.ParticipantesReuniao, ReportClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
                ReportViewer1.ReportServiceUri = new Uri("../ReportService.svc", UriKind.RelativeOrAbsolute);
                ReportViewer1.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(ReportViewer1_RenderBegin);
                
            }
            catch(Exception e)
            {
            }

        }

        void ReportViewer1_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
        {
            args.ParameterValues["REUNIAOID"] = 1010;
            
        }

And in code-behind of my report I do that:

   void ParticipantesReuniao_NeedDataSource(object sender, System.EventArgs e)
        {
            Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;

            this.sqlDataSource1.Parameters[0].Value = report.Parameters["REUNIAOID"].Value;

            // Set the SqlDataSource component as it's DataSource
            report.DataSource = this.sqlDataSource1;
        }

But now, I want use this REUNIAOID in query builder.

How I can do that?

Thanks in advance

3 Answers, 1 is accepted

Sort by
-1
Steve
Telerik team
answered on 19 Dec 2011, 04:10 PM
Hi Manuel,

Check the Using Parameters with the SqlDataSource component help article for more info on your inquiry, specifically Binding SQL Query Parameters to Report Parameters section.

Greetings,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Manuel
Top achievements
Rank 1
answered on 19 Dec 2011, 04:51 PM
Hi Steve,

I look at this link and no help. Maybe I explain me wrong.

I want select some data in silverlight side and pass this to report query? This is possible?

Any help please??

Thanks
0
Manuel
Top achievements
Rank 1
answered on 20 Dec 2011, 10:14 AM
Hi there,

I´m already fix the problem. Thanks.
Tags
General Discussions
Asked by
Manuel
Top achievements
Rank 1
Answers by
Steve
Telerik team
Manuel
Top achievements
Rank 1
Share this question
or