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

E-mailing with Parameter

3 Answers 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 12 Jun 2008, 05:05 AM

I have a Telerik Reporting Q1 2008 SP1 and a report that I pass a parameter to. I have it setup to load in a RadWindow and it works great.

I would like to e-mail the report and if I hardcode the parameter in it works great. 

What I can’t figure out is how to pass the parameter to the report when it generates it for e-mail.

If anyone has any suggestions I would appreciate it.

Thanks,

Brett

3 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 12 Jun 2008, 11:05 AM
Hello Brett,

In order to answer your question, we need to know exactly how you generate the report for e-mail and from where you want to pass the parameter. Any code snippets will be appreciated as well.

Regards,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brett
Top achievements
Rank 1
answered on 12 Jun 2008, 02:53 PM
In the Report, I just followed the online video for Design Time Support for Parameterized Queries and put in:

 public string Param1  
        {  
 
            get 
            {  
                return (string) sqlDataAdapter1.SelectCommand.Parameters[0].Value;  
            }  
            set 
            {  
                sqlDataAdapter1.SelectCommand.Parameters[0].Value = value;  
            }  
 

Then in my RadWindow I pass it an argument with a:

ReportViewer1.Report = new MasterQuote();  
(ReportViewer1.Report as MasterQuote).Param1 = QuoteID;  
 

How would I do that if I wanted to generate an e-mail?

Thanks,

Brett


0
Chavdar
Telerik team
answered on 13 Jun 2008, 01:26 PM
Hello Brett,

The way of setting a parameter value is identical regardless whether you show the report in a report viewer or mail it. Here is a link to a forum post which describes how you can mail a report. Prior to calling the mail method you can set the parameter value.

All the best,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Brett
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Brett
Top achievements
Rank 1
Share this question
or