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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting Reports and Graphics 1

Status
Not open for further replies.

ebizleads

Technical User
Sep 14, 2005
57
US
I'm using the following to output a report to a directory. The report is missing graphics (lines, rectangles) and embedded objects.

Any way to overcome this?

DoCmd.OutputTo acOutputReport, "CounselorReport-Fresh-No Dial", acFormatRTF, "C:\MyDebtIQ\C-Reports\" & "Fresh Leads" & ".rtf"

Thanks,

Ebizleads
 
You have some choices - starting with rather pretty (excactly like the Access report), but not editable - acformatsnp (snapshot format) to what you have, which looks fairly OK, but without graphics and is editable. Then you have some stuff at Stephen Lebans that might help.

Roy-Vidar
 
Another option is to look at a PDF print queue type solution (e.g. I use CutePDF, free and unrestricted from then print the report to that queue to create a fully formatted PDF. Again, not editable.

There is a way to export graphical components of a report as jpegs or bitmaps but I forget the syntax, will see if I can find it in an old database of mine and then post the code here if that is of interest?
 
Yes, thanks so much for the valuable information. Looking into the cuteftp and the graphics export help would be wonderful!

Ebizleads
 
Sorry, it's taken me a while but here's some untested code that, if run with a report open, let's you save graphical components of that report (e.g. graphs) as JPEGs.
Code:
Function fctnReportJPEG()
On Error GoTo Err_fctnReportJPEG
    Dim ctl As Control, strOutput As String, lngC As Long, fd As FileDialog
    For Each ctl In Screen.ActiveReport.Controls
        If ctl.Properties(2).Value = 113 Then
            If MsgBox("Do you want to save '" & ctl.Properties(0).Value & "' as a graphic?", vbQuestion + vbYesNo + vbDefaultButton2) = vbYes Then
                Set fd = Application.FileDialog(msoFileDialogSaveAs)
                With fd
                    .Filters.Add "JPEG files", "*.jpg; *.jpeg", 1
                    If .Show = -1 Then
                        ctl.export .SelectedItems(0), "JPG", False
                        ctl.Object.Application.Quit
                        lngC = lngC + 1
                End If
                End With
                Set fd = Nothing
            End If
        End If
    Next ctl
    If lngC = 1 Then
        MsgBox lngC & " graphic has been created.", vbInformation
    ElseIf lngC > 1 Then
        MsgBox lngC & " graphics have been created.", vbInformation
    End If
    
Exit_fctnReportJPEG:
    Exit Function

Err_fctnReportJPEG:
    MsgBox Err.Number & ": " & Err.Description, vbExclamation
    Resume Exit_fctnReportJPEG
End Function
Have assumed the SelectedItems property is a zero-based index.... don't know this for sure.

[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top