473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how ASP.NET to generate excel report

ken
how ASP.NET to generate excel report(office 2003) to client
what component i need to reference into the asp.net application
and what component i need to install to the server?

Moreover, does it free?
Feb 22 '06 #1
5 1832
"ken" <ke*@discussions.microsoft.com> wrote in message
news:2C**********************************@microsof t.com...
how ASP.NET to generate excel report(office 2003) to client
what component i need to reference into the asp.net application
and what component i need to install to the server?

Moreover, does it free?


Hi Ken,

I don't know how much control you need, but I just generate a csv file for
the user. The user is then asked to save or open the file with the default
app (ussually Excel).

This ussually works enough that I can keep it as simple as possible. I also
generate a tocsv.aspx file, so it's generic.

Good luck,
John
Feb 22 '06 #2
Ken

Create a crystal report and export the content as Excel, that's the cheapest
way
see the sample code..

ReportDocument r=new ReportDocument();
crTableLogOnInfo=new TableLogOnInfo();

rptFiles=(MapPath("Reports\\xxx.rpt"));

r.Load(rptFiles);
crDatabase=r.Database;
for (int i = 0; i < crDatabase.Tables.Count; i++)
{
crTable = crDatabase.Tables[i];
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);

}
s=(System.IO.MemoryStream) r.ExportToStream(ExportFormatType.Excel);
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.ContentType = "application/x-msexcel";
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;
filename=Report.xls");
HttpContext.Current.Response.BinaryWrite(s.ToArray ());
HttpContext.Current.Response.End();
r.Close();

Hope this help you...

vinu

"ken" <ke*@discussions.microsoft.com> wrote in message
news:2C**********************************@microsof t.com...
how ASP.NET to generate excel report(office 2003) to client
what component i need to reference into the asp.net application
and what component i need to install to the server?

Moreover, does it free?

Feb 22 '06 #3
"John" <pl*@dont.spam.me.com> wrote in message
news:y3********************@news20.bellglobal.com. ..
I don't know how much control you need, but I just generate a csv file for
the user. The user is then asked to save or open the file with the
default app (ussually Excel).


Alternatively, if you want some more "presentation" formatting, create an
HTML document and then change its extension to .xls. Excel will just
"understand" what to do with it...
Feb 22 '06 #4

Ken.

Search google.com for
GridView Excel
or
DataGrid Excel
or even
Repeater Excel

There are some simple code snipplets out there ... to "export" one of those
controls,. and write it to Excel.

Here is one:
http://www.c-sharpcorner.com/Code/20...ridToExcel.asp
"ken" <ke*@discussions.microsoft.com> wrote in message
news:2C**********************************@microsof t.com...
how ASP.NET to generate excel report(office 2003) to client
what component i need to reference into the asp.net application
and what component i need to install to the server?

Moreover, does it free?

Feb 22 '06 #5
Your easiest cheapest bet is to change the content type to excel and
response.write the content out. it will appear in the browser as a
spreadsheet. If you want more, you'll need to use a third party product.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------

"ken" <ke*@discussions.microsoft.com> wrote in message
news:2C**********************************@microsof t.com...
how ASP.NET to generate excel report(office 2003) to client
what component i need to reference into the asp.net application
and what component i need to install to the server?

Moreover, does it free?

Feb 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kurien Baker Fenn | last post by:
I have to generate a report from the database in an excel format using ASP.please help me.Thanks in advance
2
by: Tools | last post by:
WinTranslator & MacTranslator Demo Editions Generate Design Diagrams from Your Source Code in Minutes Placitas, NM ? April 5, 2004 - Excel Software is pleased to announce the immediate...
1
by: Robert Davis | last post by:
I would like to be able to create a recordset in MS Access 2000 that allows a macro to run and create a report for each ID that appears in the recordset. So I thought that I would use a scheduling...
3
by: Rana | last post by:
I developed a reporting website using ASP.NET and Microsoft Office XP. The reports are generated using Microsoft Excel. It works perfectly as designed in the development environment. I deployed it...
2
by: Martin Widmer | last post by:
Hi guys I am looking for the best way to generate new reports with reporting services for SQL server 2005. The reports will be generated programmatically from a .Net VB application. So far I see...
0
by: manoharcr | last post by:
I am using the fallowing code.... This condition generats a two different excel sheet based on IF condition If(Condtion) { response.setContentType("application/vnd.ms-excel");...
0
by: Wes Groleau | last post by:
Is there a reasonably simple way to dump an SSRS report into Excel format automatically at a scheduled time without using Report Manager/Report Server? Creating the report was easy, but we seem...
1
by: Sport Girl | last post by:
Hi everybody , i have the task of developing in Perl a script that retrieves data from 3 tables ( bugs, profiles, products) from a MySQL database called bugs and display them in an excel sheet...
1
by: Ramchandar | last post by:
I would like to create a dynamic report in excel using VB6.0. I am having many recordset and i would be using these separate recordset to prepare report in excel. I have a separate format also for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.