.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

format row in excel

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :Windows Application
i export datagridview datat to excel,but now how to format the first row to BOLD  Excel.ApplicationClass ExcelApp = new Excel.ApplicationClass(); ExcelApp[1,1]="AAA"; how to format this cells to bold

View Complete Post

More Related Resource Links

Export Dataset to excel sheet in a required format?



I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

Save excel in .xslx format using c#



My existing code converting xml in to excel and it is saving excel in .xls format.

But i need to save it in .xlsx format .

Existing code for converting xml...

XmlDataDocument xmlDataDoc = new XmlDataDocument();
            XslCompiledTransform xslTransform = new XslCompiledTransform();
            // Generate Excel Report
            using (XmlTextWriter xmlWriter = new XmlTextWriter(outputFileAndPath, System.Text.Encoding.UTF8))
                xmlWriter.Formatting = Formatting.Indented;
                xmlWriter.Indentation = 3;

Trouble importing strange column format report from Excel 2007 to SQL 08

Hi, I'm not sure whether this belongs in this section or the SSIS one so hopefully I've got it right!  Hoping someone will be able to help with a problem I'm having importing a report with header and detail rows from our antiquated POS system into SQL 2008 tables.  The reports export in Excel 2007 format and for each header row there can be one or more detail rows starting from column B.  As such I've tried several things such as openrowset, an Access 12.0 OLE DB source in SSIS and even COM automation of Excel to try and write a conditional split which will hold the header details in variables then write them to rows alongside the detail rows.  I've pasted a small sample of the data here as I wasn't able to attach it: 01/07/2010 @ 11:18 Page: 1 RECEIVING: Voucher Journal Sort: VC|Str|Vou Date|Vou #|Document SID Filter: Voucher Date: 01/06/2010@12:00a..30/06/2010@11:59p Include Item detail: DCS|Item#|Desc1|Attr|Material|Size|Qty VC Str Vou Date Vou # Qty ABC 001 15/06/2010 12345 38 E NN 66 200148 XXXXXXXX RED SHAD E NN 66 200149 YYYYYYYYY BLACK GO E PP 60 200154 ZZZZZZZZZ BLACK CDE 002 16/06/2010 13839 8 F SA 35 217500 XXXXXXXX Natural F SA FL 218674 YYYYYYYYY Chalk F SA WE 221462 ZZZZZZZZZ White FGH 001 21/06/2010 13905 3 F SH 85 126260 XXXXXXXX Navy IJK 001 23/06/2010 13914 3 E AA 61 250005 YYYYYY

Unable to export data to an excel file in grid format!!!

I'm exporting data to an excel sheet from the ojects list. The data is exporting to excel sheet well, but I'm unable to see the grid format for the data. The data is looking with out the rows and columns lines. I think I'm missing to set some property or somethnig ehwn exporting.   Any help would be really appriciated.

date format in excel using c#

i have a datagridview and one of the column is date with format dd/MM/yyyy HH:mm:ss but when i export to excel the date format become 'd/m/yy HH:mm' how can i format the column in excel with the date format 'dd/MM/yyyy HH:mm:ss' i am using below method Excel.ApplicationClass ExcelApp = new Excel.ApplicationClass(); Excel._Worksheet oSheet;  oSheet = (Excel._Worksheet)oWB.Worksheets[1];

ASP.NET-Gridview - Export to excel- column format

Hi All, I am exporting gridview data into excel sheet. I have a column  which is a code for which data is like 012,013 etc. But when this data is being exported , in the excel sheet I can see the data as 12,13,14. but actually it should be 012.... Is there any way to specify the format of such columns in my datatable so that they are in the same manner as in the database? Please provide some information on this.Thanks in advance.

SSRS 2005 Render Format Excel Issue with Time Field


I have a report that uses a datetime field but gets populated only with the time. So, in SQL db, it gets stored with a default date value of 1899-12-30 12:01:01 with the correct time filled in. Report in SSRS Preview mode displays the value just fine when I use the Time format in Layout mode. I build and deploy and able to view the report in a web browser with no problem displaying the time field. But when I subscribe to the report and choose Excel render format, when I open up the Excel file from the email that was sent, I get negative decimal values. I have tried every possible Time format in SSRS but I get the same result. I also tried just the default and still gives me negative decimal values that show up as ####### in Excel.

Any help will be greatly appreciated. Thanks

How to Convert Excel 2003 (.xls) format to Excel 2007 (.xlsx) programmatically in asp.net


Hi everybody

I am using a function to save dataset tables to excel files (some xml method http://www.codeproject.com/info/search.aspx?artkw=xls+to+xlsx&sbo=kw ) in xls format(excel 2003) but the excel file which is created taking 10 times more file size than conventional one.

And after that when I am converting to excel 2007 format I am getting the normal size for that file.

Now can anyone tell me how to convert excel 2003 file format to excel 2007 file format programmatically through asp.net

Thanks everyone in advance.


Difference in Excel Format Display in Different Machines when i export from ssrs2008R2


i develop one report  and i am using ssrs2008R2

  • when i exporting into excel sheet its dispaly perferct in my mechine (means printview shows perferct with looose any column )
  • when my tester exporting into excel sheet its dispaly different meas missing last coloums in report  

Both are using WINDOWS7 Enterprice ,office2007 ,ssrs2008R2  

Please note that the reports gets generated in my machine, say System A, as expected. But as I figured out that in some machines, say System B,  the reports generated are having alignment problems.
I had compared the System A and System B machines in the following parameters :
1) System Resolution - 1024x768 (Same)
2) Microsoft Office Excel Versions - 2007 (Same)
3) Remote Desktop Login into System B from System A -- Reports are properly displayed
    Remote Desktop Login into System A from System B -- Reports are not properly displayed

can Plz help me as possible as earliy

my mail address :praveen6867@gmail.com

Generate report in Excel format with formulas



I have a report with simple calculations (adds some fields). The report is requested in excel format via Reporting Services WebService.

I would like to have the generated excel file to have the formulas, not just the results. I tried to put the formula text in report definition, but it does't work, it appears in excel as text, not as formula.

How can I do this?



move table from excel to sql in pivot format.


Hi All, i have a table in excel as follows and i want to move all records from excel to sql but in pivot format.

field 1              S5803                      S5597                  S5825

A002             S5803_v12009       S5597_v12009        S5825_v12009

-----               --------------           -------------              --------------

and the table i want in sql as :

Code          Contract         MaterialCode

A002             S5803          S5803_v12009

A002             S5597       

How to convert InfoPath form from sharepoint form library (xml format) to Excel format?


I've read about Document Converters in Sharepoint, and using xslt and xml mapping. 

What is the best way to convert InfoPath form with data in sharepoint form library (in xml format) to Excel format?

And how to do it?


Is there a way to export a datagrid to an Excel or html format file?

Hi all.. thanks for taking the time to help in advance!! :)

I've written a win application that has a datagrid which displays certain contents from a database, is there a way to allow the user to export the contents of that datagrid to maybe an excel file or html file so they can print it out themselves? I've done a lot of googling and most i could find were for web applications and not winform.. can someone point me in the right direction?

Thanks very much guys! :)

Pivot table format reset after refreshment in excel 2007



i create an excel 2007 sheet that contains a pivot table which reads from my AS cube, and i format that pivot table with special formats like adding borders and changing some colors, ... and so.


the next time i need to refresh the pivot table data and when i do so all my formats is reset.


what should I do to disable this functionality ?





Heba El-Desouky

Import Multiple Excel Files of Different Format

Looking for suggestion on how to go about importing multiple distinctly different excel spreadsheets into separate tables. File names will be unique and wondered what options there are in SSIS to conditionally process files. Running SQL Server 2005 and BIDS 2005. What I would like to stay away from is 1 package for each file. Thanks.

excel sheet is non editable format



I have uploaded excel sheet to document library on MOSS 2007 and give the link to users.

When user click on that link excel sheet is open but the problem is when user open this sheet & if user make any changes & save then that changes save on excel sheet.

if user make any changes then that shoud not save in excel sheet which is located on server.please tell me what to do.?

Excel rendering format



I have a requirement to develop a report where I have to show data in both ssrs and in excel format rendering. But when I am rendering the report in excel format, all the excel cells are not showing up any borders. How can I show the all the cell border and formatting correctly in excel? Please suggest..



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend