Click here to Skip to main content
15,903,724 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Div inside another div not sizing correctly in the user control Pin
gottimukkala25-Apr-08 5:36
gottimukkala25-Apr-08 5:36 
QuestionNeed help with passing value via OnCheckedChanged event [modified] Pin
the_0live25-Apr-08 4:03
the_0live25-Apr-08 4:03 
GeneralRe: Need help with passing value via OnCheckedChanged event Pin
AlexeiXX325-Apr-08 14:07
AlexeiXX325-Apr-08 14:07 
GeneralRe: Need help with passing value via OnCheckedChanged event Pin
the_0live28-Apr-08 2:28
the_0live28-Apr-08 2:28 
GeneralRe: Need help with passing value via OnCheckedChanged event Pin
the_0live6-May-08 3:45
the_0live6-May-08 3:45 
QuestionHow to get hardcoded data to xml and that xml can be used in .Net Pin
subbu.sk25-Apr-08 2:39
subbu.sk25-Apr-08 2:39 
AnswerRe: How to get hardcoded data to xml and that xml can be used in .Net Pin
eyeseetee25-Apr-08 2:42
eyeseetee25-Apr-08 2:42 
GeneralProblume With Excel sheet Pin
santoshkomarraju25-Apr-08 2:36
santoshkomarraju25-Apr-08 2:36 
Hi Please Help me,

I am generating one excel file in button click …it’s working in local system…but when I deploy in server it shows following error…..
My system contain office 2003 .but server contain 2007 …I think it is not an issue ….....



Exception from HRESULT: 0x800A03EC
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



Stack Trace:


[COMException (0x800a03ec): Exception from HRESULT: 0x800A03EC]
Excel.WorkbookClass.SaveAs(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local) +0
CustomizeExcel.excel_view(DataSet ReportDetails, String Heading, String Filepath) +2245
Forms_frmStoreVendorEnquiry.ExportExecl() +124
Forms_frmStoreVendorEnquiry.btnMail_Click(Object sender, ImageClickEventArgs e) +450
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +86
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746

I am using Bellow Code for generate Excel File

public static string excel_view(DataSet ReportDetails, string Heading, string Filepath)
{
Application excelApp = new ApplicationClass();

excelApp.Visible = false;
string workbookPath = Filepath;
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);

Excel.Sheets excelSheets = excelWorkbook.Worksheets;
string currentSheet = "rigvessel";
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(currentSheet);

//excelWorksheet.SaveAs("D:/APR-14-VSS/OutBound/Test12345.xls", Excel.XlFileFormat.xlExcel4Workbook, Type.Missing, Type.Missing, Type.Missing
// , Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing);


string strRange;
int intAscii = 65;
Range mycell = (Range)excelWorksheet.get_Range("D14", "D14");
mycell.Value2 = Heading;
mycell.Font.Bold = true;
mycell.Font.Size = 12;

for (int xlcol = 0; xlcol < ReportDetails.Tables[0].Columns.Count; xlcol++)
{
strRange = Convert.ToChar(intAscii).ToString();
Range excelCell = (Range)excelWorksheet.get_Range(strRange + 21, strRange + 21);
//excelCell.Font.Bold = true;
excelCell.ColumnWidth = 15;
excelCell.Interior.ColorIndex = 37;
excelCell.Value2 = ReportDetails.Tables[0].Columns[xlcol].ColumnName.ToString();
Range mycell1 = (Range)excelWorksheet.get_Range("D21", "D21");
mycell1.ColumnWidth = 30;
Range EnquiryNo = (Range)excelWorksheet.get_Range("F15", "G15");
Range JobId = (Range)excelWorksheet.get_Range("F16", "F16");
Range date = (Range)excelWorksheet.get_Range("F17", "F17");
Range ClientName = (Range)excelWorksheet.get_Range("A16", "A16");
Range KindAttention = (Range)excelWorksheet.get_Range("A18", "A18");

//EnquiryNo.Value2 = "EnquiryId"+ReportDetails.Tables[1].Columns[xlcol].ColumnName.ToString();
JobId.Value2 = "JOBID :" + ReportDetails.Tables[1].Rows[0]["jobId"];
date.Value2 = "DATE :" + ReportDetails.Tables[1].Rows[0]["DATEOFENQUIRY"];
ClientName.Value2 = ReportDetails.Tables[1].Rows[0]["NAME"];
KindAttention.Value2 = "Kind Attn :" + ReportDetails.Tables[1].Rows[0]["PERSONINCHARGE"];



for (int xlrow = 0; xlrow < ReportDetails.Tables[0].Rows.Count; xlrow++)
{
Range excelCell1 = (Range)excelWorksheet.get_Range(strRange + (xlrow + 21).ToString(), strRange + (xlrow + 21).ToString());
excelCell1.Application.get_Range(strRange + (xlrow + 21).ToString(), strRange + (xlrow + 21).ToString()).HorizontalAlignment = XlHAlign.xlHAlignLeft;
excelCell1.Value2 = ReportDetails.Tables[0].Rows[xlrow][xlcol].ToString();
excelCell1.WrapText = true;
}
intAscii += 1;
}



//excelApp.SaveWorkspace(@"E:\saisuneel.xls");
//excelApp.ActiveWorkbook.Close("",@"E:\saisuneel.xls","");
string savepath;
string timestamp = DateTime.Now.ToString("yyyyMMddhhmmss");

savepath = System.Web.HttpContext.Current.Request.PhysicalApplicationPath;
savepath = savepath + @"OutBound" + @"\" + ReportDetails.Tables[1].Rows[0]["jobId"].ToString() + Heading + timestamp + ".xls";

//excelWorksheet.SaveAs(savepath, Excel.XlFileFormat.xlExcel4Workbook, Type.Missing, Type.Missing, Type.Missing
//, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing);
excelWorkbook.SaveAs(savepath, Excel.XlFileFormat.xlExcel4Workbook, Type.Missing, Type.Missing, Type.Missing
, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Thread.Sleep(1000);
excelWorkbook.Close(false, Type.Missing, Type.Missing);
excelApp.Quit();
excelWorkbook = null;
excelSheets = null;
return @"\" + ReportDetails.Tables[1].Rows[0]["jobId"].ToString() + Heading + timestamp + ".xls";

}
QuestionI have an error :'System.Web.UI.WebControls.GridView.Rows' is a 'property' but is used like a 'method' Pin
Saba0225-Apr-08 2:33
Saba0225-Apr-08 2:33 
QuestionRe: I have an error :'System.Web.UI.WebControls.GridView.Rows' is a 'property' but is used like a 'method' Pin
Vasudevan Deepak Kumar25-Apr-08 2:35
Vasudevan Deepak Kumar25-Apr-08 2:35 
GeneralRe: I have an error :'System.Web.UI.WebControls.GridView.Rows' is a 'property' but is used like a 'method' Pin
eyeseetee25-Apr-08 2:47
eyeseetee25-Apr-08 2:47 
GeneralRe: I have an error :'System.Web.UI.WebControls.GridView.Rows' is a 'property' but is used like a 'method' Pin
AlexeiXX325-Apr-08 5:42
AlexeiXX325-Apr-08 5:42 
GeneralUse One datalist into another Pin
raushan_925-Apr-08 1:42
raushan_925-Apr-08 1:42 
GeneralRe: Use One datalist into another Pin
Vasudevan Deepak Kumar25-Apr-08 2:36
Vasudevan Deepak Kumar25-Apr-08 2:36 
RantRe: Use One datalist into another Pin
Ashish Sehajpal25-Apr-08 4:41
Ashish Sehajpal25-Apr-08 4:41 
GeneralRe: Use One datalist into another Pin
AlexeiXX325-Apr-08 6:35
AlexeiXX325-Apr-08 6:35 
NewsRe: Use One datalist into another Pin
shenbin25-Apr-08 21:52
shenbin25-Apr-08 21:52 
General[Message Deleted] Pin
Krazy Programmer25-Apr-08 0:40
Krazy Programmer25-Apr-08 0:40 
GeneralRe: How to make the complete page to be appeared in Center of the Screen [modified] Pin
Reethika25-Apr-08 0:48
Reethika25-Apr-08 0:48 
GeneralRe: How to make the complete page to be appeared in Center of the Screen Pin
Krazy Programmer25-Apr-08 0:57
Krazy Programmer25-Apr-08 0:57 
GeneralRe: [Message Deleted] Pin
squattyarun25-Apr-08 1:18
squattyarun25-Apr-08 1:18 
GeneralRe: [Message Deleted] Pin
Ashish Sehajpal25-Apr-08 1:36
Ashish Sehajpal25-Apr-08 1:36 
GeneralRe: [Message Deleted] Pin
Krazy Programmer25-Apr-08 2:14
Krazy Programmer25-Apr-08 2:14 
QuestionRe: [Message Deleted] Pin
Vasudevan Deepak Kumar25-Apr-08 2:36
Vasudevan Deepak Kumar25-Apr-08 2:36 
Questionmailing concepts Pin
Reethika25-Apr-08 0:33
Reethika25-Apr-08 0:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.