попробуйте это:
<asp:ImageButton Width="20px" Height="20px" ID="btnPdf" runat="server"
OnClick="btnExport_Click" ImageUrl="~/Images/PDF.png" AlternateText="Export To PDF" CssClass="AddedButton" />
<asp:ImageButton Width="20px" Height="20px" ID="btnXls" runat="server"
OnClick="btnExport_Click" ImageUrl="~/Images/XLS.png" AlternateText="Export To Excel" />
<asp:ImageButton Width="20px" Height="20px" ID="btnDoc" runat="server"
OnClick="btnExport_Click" ImageUrl="~/Images/DOC.png" AlternateText="Export To Word" />
C # код:
protected void btnExport_Click(object sender, EventArgs e)
{
// Stop buffering the response
Response.Buffer = false;
// Clear the response content and headers
Response.ClearContent();
Response.ClearHeaders();
try
{
string senderID = ((ImageButton)sender).ID;
if (senderID == "btnPdf")
reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, Page.Title);
else if (senderID == "btnXls")
reportDocument.ExportToHttpResponse(ExportFormatType.ExcelRecord, Response, true, Page.Title);
else if (senderID == "btnDoc")
reportDocument.ExportToHttpResponse(ExportFormatType.WordForWindows, Response, true, Page.Title);
// There are other format options available such as Word, Excel, CVS, and HTML in the ExportFormatType Enum given by crystal reports
}
catch (Exception ex)
{
//error management
}
}