mohaned
asked on
How to make printable ASP reports
i was developing project using ASP and SQL Server 2000
, and i retrieve data from Back-End (SQL) to Front-End(HTML)
and show it in html table.
i want make JUST data in this table to be printable in formatted reports.
Thanx in advance
and sorry for my english
, and i retrieve data from Back-End (SQL) to Front-End(HTML)
and show it in html table.
i want make JUST data in this table to be printable in formatted reports.
Thanx in advance
and sorry for my english
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try this. It will make your ASP page create Word or Excel reports :)
At the top of your ASP page, add these two lines for Word:
<% Response.ContentType = "application/ms-word" %>
<% Response.AddHeader "Content-Disposition", "attachment;filename=myrep ort.doc" %>
Or these for Excel.
<% Response.ContentType = "application/ms-vndexcel" %>
<% Response.AddHeader "Content-Disposition", "attachment;filename=myrep ort.xls" %>
Make sure to open new IE windows for changes to take effect.
At the top of your ASP page, add these two lines for Word:
<% Response.ContentType = "application/ms-word" %>
<% Response.AddHeader "Content-Disposition", "attachment;filename=myrep
Or these for Excel.
<% Response.ContentType = "application/ms-vndexcel" %>
<% Response.AddHeader "Content-Disposition", "attachment;filename=myrep
Make sure to open new IE windows for changes to take effect.
Of course to do that, your IIS web server must have Office (both Word and Excel) installed and ready to go, correct?
No, office is needed on the client only to view the files (If you don't have office even on your client, you can still download the file and view it on another PC).
ASKER
May be the simple solution is combination of answer from VirusMinus and answer from jmelika
but i thought it is an other tools (may be an individual software ) to prepare and format a report firstly before previewing and printing it.
but i thought it is an other tools (may be an individual software ) to prepare and format a report firstly before previewing and printing it.
Mohaned,
It's really all about designing a layout of your table, and displaying your data in them using Response.Write with a loop. If you're having difficulty with any of those things, feel free to ask for mroe help and we'll be here.
Good luck!
JM
It's really all about designing a layout of your table, and displaying your data in them using Response.Write with a loop. If you're having difficulty with any of those things, feel free to ask for mroe help and we'll be here.
Good luck!
JM
if (window.print) document.write('<form><inp
<script>