473,382 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Merge reports into one report

83
Is there a way to merge seperate reports into one report. And/Or is there a way to merge reports together and auto generate a pdf.
May 3 '07 #1
3 12418
NeoPa
32,556 Expert Mod 16PB
  1. Not that I know of other than designing a report to show data from a dataset which would include both original datasets. It's also possible to use the concept of Sub-reports though. That may help, depending on what you're actually asking.
  2. There may be some third-party code for auto-generating a PDF. I still do that manually via an Acrobat Distiller printer on my system.
May 4 '07 #2
For combining forms, the easiest way is Subforms, just run help for directions on how to do that.
As far as creating a PDF, I would create a Macro to open the Form, and use the PrntOut option to send it to an AdobePS Printer. This printer is installed as part of the Distiller from Adobe.
Hope this helps,
Nick
May 4 '07 #3
I export multiple reports to RTF files. Then from access, open word, run VBA code in Access to merge the output files into one Word documnet (essentially running a Word macro from withing Access). You must have to have the office and word libraries attached via references in your VBA module(s).

If you're using Word2007 then you would be able to save it as a PDF file.

The code for my sub is below. It's not tidy but it works!

Ray

Expand|Select|Wrap|Line Numbers
  1. Dim od, ap, ofln, nfln, mn, act, myfco, myfcn As String
  2. Dim WordApp As Object
  3. Dim WordDoc As Object
  4. Dim fs As Object
  5. Dim myDir, myBaseFileNme As String
  6. Dim i As Integer
  7. Dim a As Variant
  8. ' get and set parameter for output directory
  9. current_dir = Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))
  10. od = current_dir & "Output\" 
  11. On Error GoTo errorCOPY ' if error in finding the default results front page.doc then warn
  12. ' copy the default front page to a new name to open it for the merge
  13. ofln = "default results front page.doc"
  14. nfln = "final results.doc"
  15. myfco = od & ofln
  16. myfcn = od & nfln
  17. ' do the file copy
  18. FileSystem.FileCopy myfco, myfcn
  19. Set WordApp = CreateObject("Word.Application")
  20. Set WordDoc = WordApp.Documents.Open(myfcn)
  21. WordApp.Visible = True
  22. ' Word Macro commands follow
  23. With WordApp.ActiveWindow
  24.     .Selection.EndKey Unit:=wdStory
  25.     ' search for any reports files in the current directory
  26.     Set fs = Application.FileSearch
  27.     With fs
  28.         ' get the current path for the document (as set previously in sub)
  29.         .LookIn = od
  30.         ' loop through all the reports and merge
  31.         .FileName = "R*.RTF"
  32.         If .Execute(SortBy:=msoSortbyFileName, SortOrder:=msoSortOrderAscending) > 0 Then
  33.             For i = 1 To .FoundFiles.Count
  34.                 a = .FoundFiles(i)
  35.                 WordApp.ActiveWindow.Selection.TypeParagraph
  36.                 WordApp.ActiveWindow.Selection.InsertFile FileName:=a, Range:="", ConfirmConversions:= _
  37.                     False, Link:=False, Attachment:=False
  38.             Next i
  39.         End If
  40.     End With
  41.     .Selection.HomeKey Unit:=wdStory
  42. End With
  43. Set WordApp = Nothing
  44. Exit Sub
  45. ' this is the errorhandler
  46. errorCOPY:
  47. msgbox "Couldn't find the file - default blank report.doc in the Output directory." & Chr$(13) & "Run Aborted. Check file location!", vbCritical, "File Not Present"
Jul 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bruno Ferreira | last post by:
I everyone! Can you help me solving this problem? I have a asp.net app that creates a single Crytal Report and convert it to a PDF file. Because my Report has a lot of textBox the Web Server...
1
by: tklapettek | last post by:
Hello, I want to deploy Crystal Reports 10 without using merge-modules. I'm using Crystal Reports 10 developer edition. So I created a report in CR10 and call in in .Net 2003 (see example below)....
3
by: louise | last post by:
hi i am trying to set up a mail merge button which takes records from a multi-select listbox (the contents of which are decided by a query created by a search from) and not from a specific...
2
by: John MacIntyre | last post by:
Hi, 3 years ago I needed a mail merging report to fax .. and I needed it fast. Access reports did not look like they could be merged at first glance and I didn't have time to research it so I...
0
by: Emily Jones | last post by:
The client needs mail merge. It's a database for a training company. Sometimes a paragraph, sentence or whatever might be present/absent/different depending on what sort of course it is, what sort...
6
by: crealesmith | last post by:
Firstly, I have no problem with mail merging to Word, VB code for that works perfectly. On one mail merge I need to merge 15 fields of data that are from 3 seperate records. The 3 records are all...
4
by: Tom Jones | last post by:
I have an application that was originally built using Visual Studio 2003 that I upgraded to Visual Studio 2005. When I attempt to build the *.msi file in the deployment project, I am getting a...
3
by: veaux | last post by:
Adobe has WAY to many forums and I wasn't sure which was correct so thought I'd try here first. I'm trying to see if there is a product that will allow us to create a large (1,100 pg) directory,...
0
by: Claire | last post by:
Hi, I developed an application that uses Crystal Reports in visual studio 2005 then ported the whole application to VS2008. My original setup/deployment application (created within visual studio)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.