or
CS:<
asp:LinkButton
ID
=
"ExportToExcel"
ToolTip
=
"Export to Excel"
runat
=
"server"
Text
=
"Export To Excel"
CommandName
=
"Export"
OnClick
=
"ExportToExcel_Click"
/>
protected
void
ExportToExcel_Click(
object
sender, EventArgs e)
{
RadGrid.ExportSettings.FileName =
"filename"
;
RadGrid.ExportSettings.IgnorePaging =
true
;
RadGrid.ExportSettings.ExportOnlyData =
true
;
RadGrid.ExportSettings.OpenInNewWindow =
true
;
RadGrid.MasterTableView.UseAllDataFields =
true
;
RadGrid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
RadGrid.MasterTableView.HierarchyDefaultExpanded =
true
;
// first level
RadGrid.MasterTableView.DetailTables[0].HierarchyDefaultExpanded =
true
;
// second level
RadGrid.MasterTableView.ExportToExcel();
}
<telerik:RadHtmlChart runat=
"server"
ID=
"RadHtmlChart2"
DataSourceID=
"SqlDataSourceActionColor"
OnDataBound=
"RadHtmlChart2_DataBound"
>
<PlotArea>
<Series>
<telerik:ColumnSeries DataFieldY=
"Value"
Name=
"IncidentByMonth"
>
</telerik:ColumnSeries>
</Series>
<XAxis DataLabelsField=
"COLOR"
>
<LabelsAppearance RotationAngle=
"300"
>
</LabelsAppearance>
</XAxis>
<YAxis>
<TitleAppearance Text=
""
>
</TitleAppearance>
</YAxis>
</PlotArea>
<Legend>
<Appearance Visible=
"false"
>
</Appearance>
</Legend>
<ChartTitle Text=
"Near Miss by Risk Category"
>
</ChartTitle>
</telerik:RadHtmlChart>
<asp:SqlDataSource ID=
"SqlDataSourceActionColor"
runat=
"server"
ConnectionString=
"<%$ ConnectionStrings:OSHAConnectionString %>"
SelectCommand="
select a.COLOR,
a.Action,
b.Value
from (
select
'RED' as COLOR, 'ACTION NECESSARY' as Action UNION ALL
select
'YELLOW' as COLOR, 'ACTION APPROPRIATE IF PRATICAL AND ECONOMIC' AS ACTION UNION ALL
select
'GREEN' as COLOR, 'NO ACTION REQUIRED' AS ACTION
) a
LEFT OUTER JOIN (
select count(ID) as Value,
ActionColor,
Action
from [aaa_v_ReportingData]
where YEAR = @Year
and Location = @Location
group by ActionColor,
Action
) B ON B.ACTIONCOLOR = A.COLOR">
<SelectParameters>
<asp:ControlParameter ControlID=
"RadComboBox2"
Name=
"Year"
PropertyName=
"SelectedValue"
/>
<asp:ControlParameter ControlID=
"RadComboBox1"
Name=
"Location"
PropertyName=
"SelectedValue"
/>
</SelectParameters>
</asp:SqlDataSource>