Solved

Exporting asp:Repeater display contents to MS-EXCEL 2010

Posted on 2011-09-30
8
1,475 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

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 shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will learn how to dynamically set the form action using jQuery.
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…

749 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