when evere i am generating a excel sheet i am getting error
"the file you are trying to open ,"RiskReport.xls" ,is in a different Format than soecified by the file extention. verify that file is not corrupted and is from a trusted source befor opening the file. Do you want to open the file now. "
if i am cliking on YES then only file is open without data if "no" then alll file is open successfully.
byte[] data = new System.Text.ASCIIEncoding().GetBytes(theWorkbook.ToString());
if (format == "Excel")
{
Byte[] fileContent = manager.GetRiskReportByte(format, orgRecNos, noPendingProposals, isPendingProposals, isDisapprovedProposals, dateFrom, dateTo, minRiskScore, maxRiskScore, dataOnlyValue, riskScoreRecNos, isUnassessed, orderByParam, orderByFlow, isAllRisk);
const string fileName = "RiskReportxl" + ".xls";
try
{
response.ContentType = "application/xls";
response.AddHeader("content-disposition", "attachment; filename=" + fileName);
response.BinaryWrite(fileContent);
response.End();
}
[edit]SHOUTING removed, overenthusiastic HTML encode fixed - OriginalGriff[/edit]