[RAPOR] iki raporu tek dosyada birleştirmek ve ayrı numaralandırmak
#13
sn jon206
kusura bakmayın bir sorum daha olacak,
bu yaptığımız merge içerisine tablonun attachment alanında bulunan bir eki dahil edebilirmiyiz. yani bizim örneğimizdeki 1_HEADER_RAPORU, 2-DATA RAPORU ve attachment alanında duran bir ek nasıl merge edilebilir?



  Alıntı
Bu mesajı beğenenler:
#14
bu merge edilecek raporu 3'e çıkarmak istersem kodda nasıl bir eklenti yapmam gerekli? teşekkürler ilginize



  Alıntı
Bu mesajı beğenenler:
#15
sn mdongul;
sorunun çözüldüğüne sevindim..
3 ve daha fazlası için de başka kod la işi çözeceğiz..

tetikleyici ilk komut düğmesini bu şekilde değiştir..
Visual Basic
  1. Private Sub Komut1_Click()
  2. DoCmd.OutputTo acOutputReport, "1_HEADER_RAPORU", acFormatPDF, CurrentProject.Path & "\PDF1.PDF", False
  3. DoCmd.OutputTo acOutputReport, "2_DATA_RAPORU", acFormatPDF, CurrentProject.Path & "\PDF2.PDF", False
  4. DoCmd.OutputTo acOutputReport, "ek", acFormatPDF, CurrentProject.Path & "\PDF3.PDF", False
  5. Call MergePDFs
  6. End Sub



sonra da alttaki kodu vba yapıştır..
Visual Basic
  1. Sub MergePDFs()
  2. ' ZVI:2013-08-27 http://www.vbaexpress.com/forum/showthread.php?47310-Need-code-to-merge-PDF-files-in-a-folder-using-adobe-acrobat-X
  3. ' Reference required: "VBE - Tools - References - Acrobat"
  4. Const MyFiles = "pdf1.pdf,pdf2.pdf,pdf3.pdf" ' bulunacak pdf dosyaları
  5. Const DestFile = "MergedFile.pdf" ' birleştirlen en son pdf dosyası
  6.  
  7. Dim A As Variant, i As Long, n As Long, ni As Long, p As String
  8. Dim AcroApp As New Acrobat.AcroApp, PartDocs() As Acrobat.CAcroPDDoc
  9. Dim MyPath As String
  10.  
  11. MyPath = CurrentProject.Path ' pdflerin kayıtlı olduğu klasör yolu
  12.  
  13. If Right(MyPath, 1) = "\" Then p = MyPath Else p = MyPath & "\"
  14. A = Split(MyFiles, ",")
  15. ReDim PartDocs(0 To UBound(A))
  16.  
  17. On Error GoTo exit_
  18. If Len(Dir(p & DestFile)) Then Kill p & DestFile
  19. For i = 0 To UBound(A)
  20. ' Check PDF file presence
  21. If Dir(p & Trim(A(i))) = "" Then
  22. MsgBox "File not found" & vbLf & p & A(i), vbExclamation, "Canceled"
  23. Exit For
  24. End If
  25. ' Open PDF document
  26. Set PartDocs(i) = CreateObject("AcroExch.PDDoc")
  27. PartDocs(i).Open p & Trim(A(i))
  28. If i Then
  29. ' Merge PDF to PartDocs(0) document
  30. ni = PartDocs(i).GetNumPages()
  31. If Not PartDocs(0).InsertPages(n - 1, PartDocs(i), 0, ni, True) Then
  32. MsgBox "Cannot insert pages of" & vbLf & p & A(i), vbExclamation, "Canceled"
  33. End If
  34. ' Calc the number of pages in the merged document
  35. n = n + ni
  36. ' Release the memory
  37. PartDocs(i).Close
  38. Set PartDocs(i) = Nothing
  39. Else
  40. ' Calc the number of pages in PartDocs(0) document
  41. n = PartDocs(0).GetNumPages()
  42. End If
  43. Next
  44.  
  45. If i > UBound(A) Then
  46. ' Save the merged document to DestFile
  47. If Not PartDocs(0).Save(PDSaveFull, p & DestFile) Then
  48. MsgBox "Cannot save the resulting document" & vbLf & p & DestFile, vbExclamation, "Canceled"
  49. End If
  50. End If
  51.  
  52. exit_:
  53.  
  54. ' Inform about error/success
  55. If Err Then
  56. MsgBox Err.Description, vbCritical, "Error #" & Err.Number
  57. ElseIf i > UBound(A) Then
  58. MsgBox "The resulting file is created:" & vbLf & p & DestFile, vbInformation, "Done"
  59. End If
  60.  
  61. ' Release the memory
  62. If Not PartDocs(0) Is Nothing Then PartDocs(0).Close
  63. Set PartDocs(0) = Nothing
  64.  
  65. ' Quit Acrobat application
  66. AcroApp.Exit
  67. Set AcroApp = Nothing
  68.  
  69. End Sub






imza; jon206
www.access-sql.com



  Alıntı
Bu mesajı beğenenler:
#16
çok teşekkürler
bir de bu yaptığımız merge içerisine tablonun attachment alanında bulunan bir eki dahil edebilirmiyiz. yani bizim örneğimizdeki 1_HEADER_RAPORU, 2-DATA RAPORU ve attachment alanında duran bir "Attachment1" ismindeki bir PDF nasıl merge edilebilir?



  Alıntı
Bu mesajı beğenenler:
#17
attacchment'lere de rapor düzenleyip onu da pdf içine atabilirsiniz..
imza; jon206
www.access-sql.com



  Alıntı
Bu mesajı beğenenler:


Benzer Konular...
Konu: Yazar Cevaplar: Gösterim: Son Mesaj
  [RAPOR] Raporda Açılan Ve Kalıcıları Evet Yapınca Raporu Alamıyorum akinokrizo 3 324 27-10-2025, 18:12
Son Mesaj: akinokrizo
  [RAPOR] Access De Ki Raporu Word Belgesi Olarak Vba Kodu Ile Açma Ahmet51 10 889 01-08-2024, 10:28
Son Mesaj: dsezgin
  Ilgili Raporu Mail Gönderme Mtaner 6 1.507 21-05-2024, 07:09
Son Mesaj: dsezgin
  [VBA] Bir Tabloda Alan Türü Uzun Metin Olan Iki Ayrı Alanı Karşılaştırmak abkbek 13 1.189 10-11-2023, 22:26
Son Mesaj: abkbek
  Iki Farklı Yazıcıya Iki Farklı Raporu Yazdırmak adnnfrm 5 505 08-10-2023, 05:34
Son Mesaj: dsezgin
  [RAPOR] Açılan Raporu Pdf Olarak Kaydetmek hnakis 1 434 24-05-2023, 07:53
Son Mesaj: alperalper
  Toplu Taksitlendirme Işleminde Her Taksit Için Tabloya Ayrı Kayıt Nasıl Yapabilirim. OĞUZ TÜRKYILMAZ 10 1.227 12-03-2023, 21:18
Son Mesaj: OĞUZ TÜRKYILMAZ
  [VBA] Alt Rapor Içeren Bir Rapor Her Personel Için Ayrı Excel Sayfasına Atılabilir Mi? abkbek 12 1.357 29-01-2023, 13:29
Son Mesaj: abkbek

Foruma Git:


Bu konuyu görüntüleyen kullanıcı(lar): 1 Ziyaretçi