Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to display the output header string in bold in excel sheet..how to do it? below is my code

C#
WorksheetRow[] row = new WorksheetRow[Rep.Tables[0].Rows.Count];
                WorksheetRow[] rowz = new WorksheetRow[3000];

                for (int i = 0; i < Rep.Tables[0].Rows.Count; i++)
                {
                    string str = "", s = "Monthly Modeling";
                    str=dt.Rows[i][0].ToString();
                    row[i] = sheet.Table.Rows.Add();
                    if (str != emp)
                    {
                        rowz[i] = sheet.Table.Rows.Add();
                        rowz[i].Cells.Add(s + str );//This will be displayed in excel,how to make it Bold???
                        row[i] = sheet.Table.Rows.Add();
                    }
Posted

Have you tried something like this?

C#
rowz[i].Cells.Font.Bold = true;
 
Share this answer
 
Comments
ahmed ali mohd 19-Nov-13 0:39am    
yes, but it is not working,,,,cells.Font is not available
C#
excel.Worksheet wsht;
wsht.Cells[i, j].Font.Bold=true;


Hope this will help you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900