 |
|
 |
you use (Visual studio 2008, C#): using Excel = Microsoft.Office.Interop.Excel; and a reference to Microsoft Excel 12.0 Object Library and System.drawing
cheers
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I'm new to the programming thing; and your sample code proved very helpful.
Question i'm using the sheetwise way off exporting, with each dataset goes to a sheet.
in my scenario my dataset comes from a SQL procedure and i've add a couple columns to the datasets before exporting to excel. So i have my datasets per sheet with empty columns that i would like to add formulas that would involve cell within the same row to.
is there any way i incorporate this during the export process?
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
 |
Krishna,
I am having problems downloading your code into my machine, since the version is different. Could you please email me the code so that I could use it in my project. (drshreya at gmail dot com)
Your reply will be greatly appreciated.
Thanks, Shreya
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
It takes ages for my 20k records and 5 col ....
took almost 10 mins to return me the excel ..rest al is good .... m i missing anything ????
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It looks like the formatting happens in the looping over rows instead of across bigger ranges. Probably needed this to format alternating row colors.
Still using lots of com. I thought there was a way to send an array over and that went faster. need to check the old notes.
Shouldn't take much to fix up.
-- modified at 16:40 Tuesday 30th January, 2007
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
yep, could use arrays and ranges, need to keep an eye on the use of rowspace and columnspace.
still shouldn't take long to touch up.
I knew these years of programming would come in handy somewhere.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello Friends,
I am having a problem with this code. The excel application does not open. I see in the task manager that the Excel.exe process is started when I run the code, but the application will not open. Any ideas? The only thing I notice on the task manager is that the user name of the process is a guess user, not the user I am logged in as.
I appreciate any help Maria
Thanks Maria
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
I have just now tested your code which is fine. However, it shuold by possible to speciefy a file name and a workbook name.
Thanks.
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
 |
Hi , thanks for your article .
When i try to use, i received this message
namespace name 'Excel' is missing namespace name 'VBIDE' is missing
where i can find this assemblies ?
best Regards
Lucio Bispo(lbispo@hsbc.com.br)
|
| Sign In·View Thread·PermaLink | 2.33/5 (10 votes) |
|
|
|
 |
|
 |
Hello, I am getting Access Denied error when i use ur code. i have also checked the permissions for the folder and everything is ok. Please find below the complete error message for more information on the same. Access is denied. 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.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 138: //excel.ExcelFormattingStyle = formatStyle; Line 139: //Pass your Dataset and Specify the style.. Line 140: excel.ExportDataToExcel(ds,GetExportStyle()); Line 141: Line 142:
I really appreciate your help on the same.
Thanks and Regards Srikanth. R
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
I'm sure your class works well although i havent tried it yet but.... Where's the article?? The idea of posting articles is to allow others to learn how you've solved your particular problem not just to post the code and leave people to it.
Kev
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Receive "Access is denied." on the following line. excel = new Excel.ApplicationClass();
any tips to resolve this problem?
Thanks, H12
H12
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
it's been a long time, but I think this is how I got it working: In web.config add: to get excel = New Excel.ApplicationClass working, added aspnet user client to excel in config mgt....highlight the folder and add aspnet and give privileges.
Control panel/admin/comp services/dcom/Microsoft excel, customize, I added aspnet on the security tab in the 3 sections.
|
| Sign In·View Thread·PermaLink | 4.25/5 (3 votes) |
|
|
|
 |
|
|
 |
|
 |
Hello Krishna, Your component is great. I use it in my project and it saves me a lot of time. Many thanks. Vincent
|
| Sign In·View Thread·PermaLink | 1.80/5 (2 votes) |
|
|
|
 |
|
 |
Hi,
My requirement is to export Russian Data stored in Oracle 9i Database to a CSV file.
When the below code is used to export data the Russian Characters are shown as Junk characters when the CSV file is opened in MSExcel. If the same file is opened in Notepad, the Russian Characters are displayed correctly.
Can someone advice, how to export Russian Characters that can also be displayed correctly when viewed in Excel Sheet.
It will be highly appreciated.
With Regards,
///////////////////////////////////////////////////////////////////////////// /////////////////////// PROGRAM CODE //////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
String strFileName = ""; FileStream fs = null; BufferedStream buff = null; StreamWriter writer = null; bool bExported = false; try { SaveFileDialog saveFileDlg = new SaveFileDialog(); saveFileDlg.Filter = "CSV Format|*.csv"; saveFileDlg.Title = "Save File"; saveFileDlg.RestoreDirectory = true ; saveFileDlg.ShowDialog();
if(saveFileDlg.FileName != "") { strFileName = saveFileDlg.FileName; saveFileDlg.Dispose(); fs = new FileStream (strFileName,FileMode.OpenOrCreate,FileAccess.ReadWrite); buff = new BufferedStream(fs); writer = new StreamWriter(buff); writer.Write(strWriteData); writer.Flush(); bExported = true; writer.Close(); buff.Close(); fs.Close(); } return bExported; } catch(Exception exp) { throw exp; } finally { writer = null; buff = null; fs = null; }
|
| Sign In·View Thread·PermaLink | 2.33/5 (6 votes) |
|
|
|
 |