2011-07-23 18 views
6

Cuando uso la función Exportar a html con Informe, Access genera varias páginas de html (cada página tiene aproximadamente 30 líneas de datos).¿Cómo exportar el informe a UN SOLO archivo html?

¿Cómo puedo forzar a Access a generar UN SOLO archivo html para todo el informe? Gracias.

+0

¿Ha intentado crear una consulta y luego exportarla como HTML? El resultado será una tabla HTML, y sin saltos de página y solo un documento. –

Respuesta

1

No se puede hacer. El tamaño del papel debe establecerse en función del controlador de la impresora. El acceso no permite el tamaño de papel definido por el usuario aunque esta opción exista en Configurar página.

3

Creé una función que puede ser útil para otros. Toma la ruta de un archivo y luego sigue los enlaces hasta que el documento esté listo. Necesita exportar el informe a un archivo html y luego usar esa ruta en esta función. Lo uso para crear un mensaje para Outlook. Esto requiere una referencia al modelo de objetos de Windows Script Host

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 
2

así que es un poco una solución divertida pero se puede exportar como .rtf, entonces abierto en Word y guardar como .htm. voila!

Cuestiones relacionadas