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

Build an invoice serverside and email

3 Answers 179 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shane P
Top achievements
Rank 1
Shane P asked on 19 Jan 2009, 07:27 AM
Hi everyone,
I have just started to play with the reporting tool provided and must say I really like it.
I am building a website that processes credit card payments using a 3rd party, I need to be able to email my users an receipt once a payment has been made. Thats were I see telerik reporting fitting in.

I have built a report that I wish to use as my template that I will contact to my datasource however I really dont know how to wire everything up.

I have an aspx page which I dont wish to show the report so I havent added a viewer but what I wish to do is create the report as a pdf and then email it. I know how to email the report but I am unsure of how I need to bind the report to my datasource,creating the pdf then sending it.

Does anyone have any tips to get me started?

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Jan 2009, 11:19 AM
Hello Shane,

You can see the supported datasources and available ways of connecting your data from our Connecting Data to a Report help section. Since you do not need to display the report, you can create it and export it entirely programmatically. Here is a blog post that describes how to email the exported file.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shane P
Top achievements
Rank 1
answered on 26 Jan 2009, 08:58 AM
Thanks Steve,

Those links were very helpful! I have nearly achieved what im trying to do.

How can I pass a parameter through to the report? I am what to use a multitier setup and pass back a parameter to the report but im not getting to far :(

In my report I have tried

 

public int invoiceID { get; set; }

 

 

public rptInvoice()

 

{

 

/// <summary>

 

 

/// Required for telerik Reporting designer support

 

 

/// </summary>

 

InitializeComponent();

 

mdPayment invoice = new mdPayment();

 

 

new brPayment().SelectStolenItemInvoice(out invoice,invoiceID);

 

txtDate.Value = invoice.invoiceDate.ToShortDateString();

However it doesn't work by calling it in this manor

 

 

protected void Button1_Click(object sender, EventArgs e)

 

{

 

rptInvoice report = new rptInvoice();

 

report.invoiceID = 212;

ExportToPDF(

"test", report);
}

so I tried adding the paramter into the report

 

public rptInvoice(int invoiceID)

However that doesn't work either.....This is surely is something me doing something stupid but I cant figure it out myself. Can you please help.

 

0
Steve
Telerik team
answered on 26 Jan 2009, 02:26 PM
Hi Shane,

You are talking about parameters, but I do not see any parameters in the code that you've pasted, only the invoiceID public field. Can you elaborate on what is it that you are trying to accomplish and we would advise you accordingly to the best of our ability. If you think a sample report would help, you can prepare one and attach it in a support ticket with corresponding instructions.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Shane P
Top achievements
Rank 1
Answers by
Steve
Telerik team
Shane P
Top achievements
Rank 1
Share this question
or