What I would like to do is have two LinkButton's that will both download the RadGrid into Excel format. Previously I did have the "ExportCSV" and "ExportToExcel" menu items turned on and the code worked just fine however I needed the names of the downloads to be something else. One version will be formatted like the RadGrid results and the other will be formatted slightly different (see below). I was hoping that with option 1 that I could just tie into the RadGrid's ability to export to .XLS but it appears as if I don't have something right. Can you offer assistance?
File option 2 I need the data formatted differently would I have to requery the database or can I just manipulate the RadGrid results?
Code behind and while running it I see the CommandName is either "ExportPrinter" or "ExportMarketing" and to see if I could get it to work I just invoked the calls to "ConfigureCSVExport" and "ConfigureExcelExport"
Currently the RadGrid displays the data as such
Company Name | Address info | CEO | CFO | Marketing Mgr | Operations Mgr
ABC Company | Main St, my town USA | Bob Smith | Susie Jones | Mr. X
For the "ExportMarketing" this format would work just fine but for the "ExportPrinter" I need the data slightly changed and wondering the best way of going about this. Need the data to appear like
Bob Smith | ABC Company | Main St, My town USA
Susie Jones | ABC Company | Main St, My town USA
Mr. X | ABC Company | Main St, My town USA
File option 2 I need the data formatted differently would I have to requery the database or can I just manipulate the RadGrid results?
<
telerik:RadGrid
ID
=
"GridContacts"
runat
=
"server"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
PageSize
=
"20"
OnNeedDataSource
=
"GridContacts_NeedDataSource"
Visible
=
"true"
>
<
GroupingSettings
CaseSensitive
=
"False"
ShowUnGroupButton
=
"false"
/>
<
ExportSettings
IgnorePaging
=
"True"
OpenInNewWindow
=
"True"
ExportOnlyData
=
"True"
FileName
=
"MarketingEmailList"
>
<
Excel
AutoFitImages
=
"True"
Format
=
"ExcelML"
/>
<
Csv
ColumnDelimiter
=
"VerticalBar"
EncloseDataWithQuotes
=
"False"
/>
</
ExportSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
IsFilterItemExpanded
=
"true"
>
<
CommandItemTemplate
>
<
asp:LinkButton
ID
=
"btnExportPrn"
runat
=
"server"
CommandName
=
"ExportPrinter"
Visible
=
"true"
><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
src
=
"/Images/DownloadPrinter.png"
/>Printer Download</
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnExportMarket"
runat
=
"server"
CommandName
=
"ExportMarketing"
><
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
src
=
"/Images/DownloadMarket.png"
/>Marketing Download</
asp:LinkButton
>
</
CommandItemTemplate
>
Code behind and while running it I see the CommandName is either "ExportPrinter" or "ExportMarketing" and to see if I could get it to work I just invoked the calls to "ConfigureCSVExport" and "ConfigureExcelExport"
Protected
Sub
RadGrid1_ItemCommand(sender
As
Object
, e
As
Telerik.Web.UI.GridCommandEventArgs)
Handles
GridContacts.ItemCommand
If
e.CommandName =
"ExportPrinter"
Then
ConfigureCSVExport()
ElseIf
e.CommandName =
"ExportMarketing"
Then
ConfigureExcelExport()
End
If
'If e.CommandName = Telerik.Web.UI.RadGrid.ExportToCsvCommandName Then
'ElseIf e.CommandName = Telerik.Web.UI.RadGrid.ExportToExcelCommandName Then
'End If
End
Sub
Currently the RadGrid displays the data as such
Company Name | Address info | CEO | CFO | Marketing Mgr | Operations Mgr
ABC Company | Main St, my town USA | Bob Smith | Susie Jones | Mr. X
For the "ExportMarketing" this format would work just fine but for the "ExportPrinter" I need the data slightly changed and wondering the best way of going about this. Need the data to appear like
Bob Smith | ABC Company | Main St, My town USA
Susie Jones | ABC Company | Main St, My town USA
Mr. X | ABC Company | Main St, My town USA