How to export a report to a single SINGLE html file?

When I use the Export to html function with Report, Access creates several html pages (each page contains about 30 lines of data).

How can I get Access to generate an ONE SINGLE html file for the entire report? Thanks.

+6
source share
3 answers

Unable to execute. The paper size must be set based on the printer driver. Access does not allow you to determine the paper size set by the user, even if this setting exists in the Page Setup section.

+1
source

I created a function that may be useful to others. It takes the path to the file and then follows the links until the document is executed. You need to export the report to an html file, and then use this path in this function. I use it to create a message for Outlook. This requires a link to the Windows Script Host Object Model

Public Function fReadFile(strFile As String) As String On Error GoTo ErrHandler Dim FSO As FileSystemObject Dim tsInput As TextStream Dim strLine, strMessage As String Dim strNextFile As String Dim blnEnd As Boolean Do While Not blnEnd Set FSO = New FileSystemObject Set tsInput = FSO.OpenTextFile(strFile, 1) Do While Not tsInput.AtEndOfStream strLine = tsInput.ReadLine If InStr(1, strLine, ">First<", vbTextCompare) > 0 And InStr(1, strLine, ">Previous<", vbTextCompare) > 0 And InStr(1, strLine, ">Next<", vbTextCompare) > 0 And InStr(1, strLine, ">Last<", vbTextCompare) > 0 Then Debug.Print strLine strNextFile = Mid(strLine, InStr(1, strLine, ">Previous</A> <A HREF=", vbTextCompare) + 23, InStr(1, strLine, """>Next<", vbTextCompare) - (InStr(1, strLine, ">Previous</A> <A HREF=", vbTextCompare) + 23)) rem put the directory back in the file name strNextFile = IIf(strNextFile <> "#", Mid(strFile, 1, (InStrRev(strFile, "\"))) & strNextFile, strFile) blnEnd = (strNextFile = strFile) Else strMessage = strMessage & strLine End If Loop tsInput.Close Set FSO = Nothing strFile = strNextFile Loop fReadFile = strMessage Exit Function ErrHandler: Debug.Print Err.Description & " " & "fReadFile" Resume Next End Function 
+3
source

well, this is a fun workaround, but you can export it as .rtf, then open in a word and save as .htm. voila!

+2
source

Source: https://habr.com/ru/post/893388/


All Articles