Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuous Report

Status
Not open for further replies.

mikeba1

Programmer
Jan 2, 2005
235
GB
I need to convert an existing report that will go to the web.
I want it to be continuous with no page breaks, so that it is one html page.
Any ideas !!
Thanks
 
Thanks Remou
I have no idea how to start a report in VBA, can you point me in a direction of some sample code.
Cheers
 
From your post it seems to me that you need HTML, rather than a report, so the best bet is to look for some ASP samples. You can also grab some of the set-up from the saved HTML output. After that, it depends on whether this is a casual report for the intranet or an important document for the internet, and whether or not it will be going to a web developer.

At the most simple:

Code:
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.CreateTextFile ("c:\docs\Report.html", False)

'Header
f.WriteLine "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN>" & vbCrLf _
& "<HTML>" & vbCrLf _
& "<HEAD>" & vbCrLf _
& "<TITLE>Report</TITLE>" & vbCrLf _
& "</HEAD>" & vbCrLf _
& "<BODY><H1>The Report</H1>"
& "<Table>"

'Recordset
Set rs = CurrentDB.OpenRecordSet("Select af, bf, cf From tblTable")

'Build table
Do While Not rs.EOF
  f.WriteLine "<TR>"
  f.WriteLine "<TD>" & rs!af & "</TD>"
  f.WriteLine "<TD>" & rs!bf & "</TD>"
  f.WriteLine "<TD>" & rs!cf & "</TD>"
  f.WriteLine "<TR>" 
  rs.MoveNext
Loop

rs.Close

'End of HTML
f.WriteLine "</TABLE></BODY></HTML>"
f.close

'View file
FollowHyperLink "c:\docs\Report.html"

You could also tack all the pages together using Word or such like, but it is tedious.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top