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

Parameters not send to report via WCF Service

1 Answer 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 22 Jul 2010, 01:56 PM
Hello,
we're currently using a silverlight report viewer and using this to pass a parameter :

   private void btnCarica_Click(object sender, RoutedEventArgs e)
        {
            cvContent.Content = null;
 
            Telerik.ReportViewer.Silverlight.ReportViewer report = new Telerik.ReportViewer.Silverlight.ReportViewer();
 
          //  report.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
          //  report.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
 
            report.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(report_RenderBegin);
            report.ReportServiceUri = new Uri("../WebServices/TelerikReporting.svc",UriKind.Relative);
            report.Report = "Web.Reports.Rendicontazione.ReportRendiconto,Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
             
            cvContent.Content = report;
//            wr = new WeakReference(report);
        }
 
        private void report_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
        {
            int i = 0;
            string idRapporto = tbRapporto.Text;
            DateTime data = dtPicker.SelectedDate.Value;
 
            args.ParameterValues["ProductCategory"] = "Components";
            args.ParameterValues.Add("a", "1");
        }

I've used a and ProductCategory as in your example just for test, but with no luck... inside the report the ReportParameters field has Count = 0

can you please tell me if it can be a bug of the reportviewer or if I'm missing something really stupid?' Can you provide me a sample demo?
Thanks

Paolo

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Jul 2010, 03:08 PM
Hi Paolo,

If the ReportParameters count is 0, this means that you have not added report parameters in the report definition. First you should define the report parameters for the report (i.e.  "ProductCategory" and "a") and after that you can pass values from the Silverlight ReportViewer as per the KB article: Programmatic Initialization of Report Parameter Values in Telerik Reporting Silverlight Viewer.

All the best,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Michele
Top achievements
Rank 2
Answers by
Steve
Telerik team
Share this question
or