or
01.
Private
Sub
RadGrid1_GridExporting(sender
As
Object
, e
As
GridExportingArgs)
Handles
RadGrid1.GridExporting
02.
03.
If
isLoc <>
True
Then
04.
05.
Dim
ms
As
New
MemoryStream(
New
UTF8Encoding().GetBytes(e.ExportOutput))
06.
07.
Dim
smtpClient
As
New
SmtpClient()
08.
smtpClient.EnableSsl =
True
09.
10.
Dim
mailMessage
As
New
MailMessage()
11.
mailMessage.IsBodyHtml =
True
12.
mailMessage.[
To
].Add(
New
MailAddress(Session(
"Email"
)))
13.
mailMessage.Subject =
"Reporting service - Do Not reply"
14.
mailMessage.Body =
"This report was sent from <br /><b>Reporting service</b> "
15.
mailMessage.Attachments.Add(
New
Attachment(ms,
"Reporting service"
& DocType))
16.
Try
17.
smtpClient.Send(mailMessage)
18.
'Label1.Text = "Message Sent"
19.
MsgBox(
"Message Sent"
)
20.
Catch
ex
As
Exception
21.
'Label1.Text = ex.ToString()
22.
MsgBox(
"Message not Sent"
)
23.
End
Try
24.
25.
Response.Redirect(Request.Url.ToString())
26.
27.
28.
29.
End
If
30.
End
Sub
<script type="text/javascript" language="javascript"> |
function Export() { |
var masterTable = $find('RadGrid1').get_masterTableView(); |
if (masterTable != null) |
masterTable.exportToExcel(); |
} |
</script> |
<telerik:RadGrid ID="RadGrid1" ShowStatusBar="True" Height="360px" |
runat="server" AutoGenerateColumns="False" AllowSorting="false" |
GridLines="None" ShowFooter="false" EnableDrag="false" |
OnNeedDataSource="RadGrid1_NeedDataSource" ExportSettings-FileName="NostroTransfer" |
OnItemDataBound="RadGrid1_ItemDataBound"> |