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

MultiValue Report Parameters

3 Answers 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
martin
Top achievements
Rank 1
martin asked on 13 Jul 2010, 11:17 PM
Can anyone give me an example of passing a multivalue parameter from a winform  to a telerik report.
Can it even be done ?

I have spent 3 days now trying to get it working with windows report viewer and devexpress reports without success.
All i want to do is allow users to select multiiple records in a gridview and passthe values to a report
So it creates an invoice. I cant believe its soo hard.
Having a 2 week deadline to get this working or its getting developed in Lotus notes and im not even sure if it can be done.

Any help on this would be appreciated as i am tearing what little hair i have left out with it.


Thanks in advance

 

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Jul 2010, 01:39 PM
Hi martin,

If you are asking about Telerik Reporting then setting a Multivalue Report Parameter value programmatically from Windows Forms Report Viewer is quite easy as shown in the following code snippet:

public Form1()
{
    InitializeComponent();
 
    var report1 = new ClassLibrary2.Report1();
    Int64[] values = {1,2,3};
    report1.ReportParameters[0].Value = values;
    reportViewer1.Report = report1;
    reportViewer1.RefreshReport();
}

If you are asking about a competitor's product then you are in the wrong forum.

Sincerely yours,
Peter
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
0
martin
Top achievements
Rank 1
answered on 15 Jul 2010, 02:15 PM
Thanks for your reply Peter I will give it a go later.
It is meant for the telerik  forums as i am looking for a solution and have tried other vendors products without success.


Martin
0
Ed
Top achievements
Rank 1
answered on 07 Oct 2010, 03:07 PM
In case it helps anyone, this also worked for me using web forms:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ShowReport.aspx.cs" Inherits="ShowReport" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=4.1.10.714, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
  Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
  <title></title>
  <link href="styles/main.css" rel="Stylesheet" />
</head>
<body>
  <form id="form1" runat="server">
  <telerik:ReportViewer ID="rv" runat="server" Height="600px" Width="633px">
  </telerik:ReportViewer>
  </form>
</body>
</html>

and

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class ShowReport : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var report = new TelerikReports.WeberLetters();
        report.ReportParameters["ID"].Value = new Int32[] { 13, 345, 999 };
        rv.Report = report;
    }
}

Ed
Tags
General Discussions
Asked by
martin
Top achievements
Rank 1
Answers by
Peter
Telerik team
martin
Top achievements
Rank 1
Ed
Top achievements
Rank 1
Share this question
or