Solved

Exporting asp:Repeater display contents to MS-EXCEL 2010

Posted on 2011-09-30
8
1,426 Views
Last Modified: 2013-12-16
I am working with ASP.NET C# 3.5 web applications and the back-end is MS SQL 2008 R2. I am displaying arround 300 records in a asp:Repeater and this contains arround 10 fields. To display the records we are using the datasource, System.Collections.Generic.List<>. It is working fine.

The new requirment is, on a button click (say EXPORT button click) I need to export all the asp:Repeater contents with headings to a MS-EXCEL 2010 file. In the EXCEL SHEET I need to add dynamic images also. (i.e.) In the exel sheet on top IMAGE1, below that asp:Repeater contents and then below IMAGE2. Please give me a sample detailed code. I havn't any idea on this type of export area.

Note:- We are using the OS, Windows 7 for developement purpose and Windows Server R2 for live publish purpose. In my Windows 7 development machine I have Visual Studio 2008 and MS-Office 2010. But the live Windows Server R2 hasn't any visual studio or any ms-office. So, the code sample code should be flexible for both.
0
Comment
  • 3
  • 3
8 Comments
 
LVL 18

Accepted Solution

by:
mgfranz earned 250 total points
ID: 36903910
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 36903978
I wanted to add 1 other link which has tons of good resources at it, http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c
 
0
 

Author Comment

by:chrisdtrinityphysicians
ID: 36910575
Hi,
   http://www.leniel.net/2009/07/creating-excel-spreadsheets-xls-xlsx-c.html  This link is my exact requirement. But by my bad luck, that example has been provided in C#.NET 4.0 Framework version and so I can't use that. I clearly mentioned, I need the solution in C#.NET 3.5 Framework version. So, can anybody give exact correct code without any errors or any compatibility errors.

Please help me...
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Expert Comment

by:mgfranz
ID: 36910834
What are you talking about?  What code samples?  The code shown on the page is said to be .NET framework 2.0.  

Are you getting compile errors?  Server-side errors?
0
 

Author Comment

by:chrisdtrinityphysicians
ID: 36911187
Sorry!!! That is due to some improper download dll error. Now it is working in local development machine. I need to test in live server. I will test on Moday and let you know the status. Thanks
0
 

Author Comment

by:chrisdtrinityphysicians
ID: 36946566
I created the excel import code with the help of the URLs http://www.leniel.net/2009/07/creating-excel-spreadsheets-xls-xlsx-c.html and http://npoi.codeplex.com/releases/view/19351. Everything is working fine in my local development machine and live server machine execpt a format issue. Please find the attachments.

 sample1.xlsx
 The above sample1.xlsx is the c# coding output. And this excel contains some fixed templates instead of blank cells. I want the blank normal cells only. How will I avoid the the fixed templates "Click to add data" from my c# coding?.

The output excel contains some template formats instead of blank cells.
Please anyone suggest some good idea.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now