USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  active report
msitoni
CURITIBA
PR - BRASIL
Postada em 14/04/2005 23:03 hs            
Tem como exportar um relatório do active reports para o formato pdf ou doc, obrigado.
 
     
msitoni
CURITIBA
PR - BRASIL
ENUNCIADA !
Postada em 15/04/2005 00:53 hs            
tentei essa rotina mas sem sucesso
 
'Dim EXL As ActiveReportsExcelExport.ARExportExcel
'Dim exportType As String
'On Error GoTo sterro1:
'GoTo st01:
'sterro1:
'If Err = 5018 Then
'MkDir "C:SDS_REPORT_OUT"
'Else
'GoTo sterr02:
'End If
'st01:'
'Screen.MousePointer = vbHourglass
'exportType = "Excel"
'DsrOrcamento.Run
'DsrOrcamento.Run
'Set EXL = New ActiveReportsExcelExport.ARExportExcel
'EXL.Export DsrOrcamento.Pages
' EXL.FileName = "C:REPORT_OUTaaaaa.xls"
'EXL.FileName = "C:DsrOrcamento" & Format(Now, "mmddhhmmss") & ".xls"
'Screen.MousePointer = vbDefault
'MsgBox "exportado"
'Exit Sub
'sterr02:
'Screen.MousePointer = vbDefault
'MsgBox "error"
   
Roßerto
Pontos: 2843 Pontos: 2843 Pontos: 2843 Pontos: 2843 Pontos: 2843
SAO PAULO
SP - BRASIL
Postada em 15/04/2005 01:12 hs            
    Dim ExportarRpx As Object
    Set ExportarRpx = New ARExportPDF
    ExportarRpx.FileName = app.path & "Pedido.pdf"
    ExportarRpx.Export Me.Pages
    Set ExportarRpx = Nothing

Roberto
roberto@vbweb.com.br
     
msitoni
CURITIBA
PR - BRASIL
Postada em 15/04/2005 01:24 hs            
Obrigado Roberto
tbm consegui fazendo assim, achei esse exemplo no site: http://www.freevbcode.com/ShowCode.asp?ID=1617
 
Private Sub ActiveReport_ReportStart()
    Me.Toolbar.Tools.Add "Exportar"
    Me.DataControl1.ConnectionString = "Provider=MSDASQL;Persist Security Info=True;Extended Properties=DBQ=" & App.Path & "AGENDA.mdb;DefaultDir=" & App.Path & ";Driver={Driver do Microsoft Access (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=" & App.Path & "access.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;PWD=1j5a0c3a7r0e;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
    Me.DataControl1.Source = "select * from taborca where ORCA_ORCA  = " & Chr(39) & FrmOrcamento.Text2.Text & Chr(39)
    Me.DataControl1.Refresh
End Sub
'Paste this code into the
 
   
 
Private Sub ActiveReport_ToolbarClick(ByVal Tool As DDActiveReports2.DDTool)
On Error GoTo EH
   
  Dim PDF           As ActiveReportsPDFExport.ARExportPDF
  Dim RTF           As ActiveReportsRTFExport.ARExportRTF
  Dim XLS           As ActiveReportsExcelExport.ARExportExcel
 
'  Dim TXT           As ActiveReportsTextExport.ARExportText
 ' Dim FrmOrcamento    As fExport
  Dim iMinPeriod  As Integer
 
  If Tool.Caption = "Exportar" Then
   
  '  Set FrmOrcamento = New fExport
   
    FrmOrcamento.dlgCommon.FileName = "Exportar" & FrmOrcamento.Text2.Text
    FrmOrcamento.dlgCommon.Filter = "Adobe Acrobat Format (*.pdf)|*.pdf|Rich Text Format (*.rtf)|*.rtf|Excel Format (*.xls)|*.xls"
    FrmOrcamento.dlgCommon.CancelError = True
    FrmOrcamento.dlgCommon.Flags = cdlOFNHideReadOnly + _
         cdlOFNLongNames + cdlOFNPathMustExist
    On Error Resume Next
    FrmOrcamento.dlgCommon.ShowSave
 
    'If user Cancelled, then error 32755 will be raised
    If Err Then
      Err.Clear
      Exit Sub
    End If
   
    On Error GoTo EH
   
    'If ther are two periods(.) in the filename, then display
    'an error
    iMinPeriod = InStr(FrmOrcamento.dlgCommon.FileName, ".")
    If InStr(Mid(FrmOrcamento.dlgCommon.FileName, _
           iMinPeriod + 1), ".") > 0 Then
      Beep
      MsgBox "Nome de Arquivo Inválido", vbOKOnly, _
           "Messangem de Exportação"
      Exit Sub
    End If
   
    Select Case True
      Case UCase(Right$(Trim$(FrmOrcamento.dlgCommon.FileName), _
             4)) = ".PDF"
        Set PDF = New ActiveReportsPDFExport.ARExportPDF
        PDF.FileName = FrmOrcamento.dlgCommon.FileName
        Me.Export PDF
        Beep
        MsgBox "Seu relatório foi savado com sucesso com o nome de  " & _
         FrmOrcamento.dlgCommon.FileName, vbOKOnly, _
         "Messangem de Exportação"
       
      Case UCase(Right$(Trim$(FrmOrcamento.dlgCommon.FileName), _
           4)) = ".RTF"
        Set RTF = New ActiveReportsRTFExport.ARExportRTF
        RTF.FileName = FrmOrcamento.dlgCommon.FileName
        Me.Export RTF
        Beep
        MsgBox "Seu relatório foi savado com sucesso com o nome de " & _
         FrmOrcamento.dlgCommon.FileName, vbOKOnly, _
         "Messangem de Exportação"
       
      Case UCase(Right$(Trim$(FrmOrcamento.dlgCommon.FileName), _
              4)) = ".XLS"
        Set XLS = New ActiveReportsExcelExport.ARExportExcel
        XLS.FileName = FrmOrcamento.dlgCommon.FileName
        Me.Export XLS
        Beep
        MsgBox "Seu relatório foi savado com sucesso com o nome de " & _
           FrmOrcamento.dlgCommon.FileName, vbOKOnly, _
           "Messangem de Exportação"
       
      Case Else
        Beep
        MsgBox "Invalid File Name", vbOKOnly, _
            "Messangem de Exportação"
        Exit Sub
    End Select
   
  End If
   
  Set PDF = Nothing
  Set RTF = Nothing
  Set XLS = Nothing
  Set FrmOrcamento = Nothing
 
  Exit Sub
 
EH:
  Set PDF = Nothing
  Set RTF = Nothing
  Set XLS = Nothing
  Set FrmOrcamento = Nothing
 
  Screen.MousePointer = vbDefault
  Beep
  MsgBox Err.Description, vbOKOnly, "Error Message"
 
End Sub
 
Obrigado.
 
     
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página