Solved

Exporting asp:Repeater display contents to MS-EXCEL 2010

Posted on 2011-09-30
8
1,440 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 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

15 Experts available now in Live!

Get 1:1 Help Now