Click here to Skip to main content
15,902,299 members
Home / Discussions / C#
   

C#

 
QuestionConfiguration settings reading - Performance perceptive Pin
N a v a n e e t h28-Nov-07 20:32
N a v a n e e t h28-Nov-07 20:32 
AnswerRe: Configuration settings reading - Performance perceptive Pin
Charith Jayasundara28-Nov-07 20:39
Charith Jayasundara28-Nov-07 20:39 
GeneralRe: Configuration settings reading - Performance perceptive Pin
N a v a n e e t h28-Nov-07 21:53
N a v a n e e t h28-Nov-07 21:53 
GeneralRe: Configuration settings reading - Performance perceptive Pin
Charith Jayasundara28-Nov-07 22:27
Charith Jayasundara28-Nov-07 22:27 
QuestionCreating a Login Form Pin
Nitin.raj28-Nov-07 20:19
Nitin.raj28-Nov-07 20:19 
AnswerRe: Creating a Login Form Pin
harleydk28-Nov-07 22:06
harleydk28-Nov-07 22:06 
QuestionHow to do Format Excel Cells in C# Pin
Charith Jayasundara28-Nov-07 18:51
Charith Jayasundara28-Nov-07 18:51 
AnswerRe: How to do Format Excel Cells in C# Pin
sreejith ss nair28-Nov-07 20:42
sreejith ss nair28-Nov-07 20:42 
Hi,
You might required to reach the required cells/range of cells to format the cells.
 Excel.Application excelApp = new Excel.ApplicationClass();<br />
   Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(File_Path,<br />
                                  0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",<br />
                                  true, false, 0, true, false, false);<br />
   Excel.Sheets excelSheets = excelWorkbook.Worksheets;<br />
   Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(fileName);<br />
   Excel.Range excelCells;<br />
<br />
   excelCells = (Excel.Range)excelWorksheet.get_Range("A1", "G1");<br />
   excelCells.Select();<br />


The above example code will select a range of cells from A1 (column name) to G1 (column name). Now you have range of required cells to apply any specific format.

Here let me explian some formating tips interms of Font style and name.

excelCells.WrapText=true;<br />
                   excelCells.HorizontalAlignment=Excel.Constants.xlCenter;<br />
                   excelCells.Borders.LineStyle=Excel.Constants.xlSolid;<br />
                   excelCells.Font.Bold = true;<br />
                   excelCells.Font.Size = 9;<br />
                   excelCells.Font.Name = "Verdana";


If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com

GeneralRe: How to do Format Excel Cells in C# Pin
Charith Jayasundara28-Nov-07 21:03
Charith Jayasundara28-Nov-07 21:03 
GeneralRe: How to do Format Excel Cells in C# Pin
sreejith ss nair28-Nov-07 21:16
sreejith ss nair28-Nov-07 21:16 
Questionremote database accessing Pin
dayya28-Nov-07 18:27
dayya28-Nov-07 18:27 
AnswerRe: remote database accessing Pin
Pankaj - Joshi28-Nov-07 18:54
Pankaj - Joshi28-Nov-07 18:54 
GeneralRe: remote database accessing Pin
dayya28-Nov-07 19:38
dayya28-Nov-07 19:38 
GeneralRe: remote database accessing Pin
Mustafa Ismail Mustafa28-Nov-07 20:45
Mustafa Ismail Mustafa28-Nov-07 20:45 
GeneralRe: remote database accessing Pin
Pankaj - Joshi28-Nov-07 21:23
Pankaj - Joshi28-Nov-07 21:23 
AnswerRe: remote database accessing Pin
Maharishi Bhatia28-Nov-07 21:24
Maharishi Bhatia28-Nov-07 21:24 
QuestionHow to store code snippent in database as it is? Pin
Satish - Developer28-Nov-07 18:15
Satish - Developer28-Nov-07 18:15 
AnswerRe: How to store code snippent in database as it is? Pin
Nouman Bhatti28-Nov-07 18:26
Nouman Bhatti28-Nov-07 18:26 
GeneralRe: How to store code snippent in database as it is? Pin
Satish - Developer28-Nov-07 18:47
Satish - Developer28-Nov-07 18:47 
Questionzooming a windows form Pin
sindhutiwari28-Nov-07 17:55
sindhutiwari28-Nov-07 17:55 
AnswerRe: zooming a windows form Pin
Sun Rays28-Nov-07 18:43
Sun Rays28-Nov-07 18:43 
GeneralRe: zooming a windows form Pin
sindhutiwari28-Nov-07 18:51
sindhutiwari28-Nov-07 18:51 
GeneralRe: zooming a windows form Pin
Sun Rays28-Nov-07 18:57
Sun Rays28-Nov-07 18:57 
AnswerRe: zooming a windows form Pin
sreejith ss nair28-Nov-07 20:49
sreejith ss nair28-Nov-07 20:49 
Questionwindows service + crystal report Pin
Vinay Dornala28-Nov-07 17:48
Vinay Dornala28-Nov-07 17:48 

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.