473,383 Members | 1,785 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,383 software developers and data experts.

Saving Access Reports as PDFs

7
** Edit ** This post was added to an existing thread (How to save an Access report to pdf with filename based on fieldname) in error so it's been moved here.

Hello to all again.

my little access query (see above), thanks to you, meets some great succes by other users. In that way that they would to integrate this to other entities. One of the users asked me if it was possible to modify it a little to obtain next result. So I need you high competencies again :o)

actually: selecting custumer nr from droplist, click on button, filtered report is created and saved as pdf file with given name (based on fieldname)

would like doing : instead of selecting customer nr from droplist just click on button, run report and save every entity, which appears in the report, as pdf file also with given name (based on fieldname.

Is this technically possible???

Once again thanks in advance

KR

Nicolas
Nov 30 '11 #1

✓ answered by TheSmileyCoder

This is where looping through a recordset comes in Handy.
Expand|Select|Wrap|Line Numbers
  1. Dim rsCustomers as Dao.Recordset
  2. Dim strSQL as String
  3. dim strReportName as string
  4.  
  5. strSQL="SELECT SAP,Cust,Hyperion " & _
  6.        "FROM [Hyperion accounts] " & _
  7.        "ORDER BY [SAP];"
  8. '(This may need to have a WHERE clause applied to it)
  9. set rsCustomers=CurrentDB.Openrecordset(strsql,dbopendynaset)
  10. Do while not rsCustomers.EOF 
  11.  strReportName = rsCustomers!Cust & "-" & rsCustomers!Hyperion & ".pdf"
  12.  DoCmd.OutputTo acOutputReport, "Rep Hyperion recon", acFormatPDF, myPath + strReportName, True 
  13.  rsCustomers.MoveNext
  14. Loop
  15.  
  16. 'Cleanup
  17. set rsCustomers=nothing
  18.  
This will print ALL your customers, so you need some way to specify which customers to print, I suppose it could be based on which customers have had orders this month, but I dont really have the details to specify such a where clause.

5 2697
Mihail
759 512MB
What mean "every entity, which appears in the report" ?
Automatic save a .pdf file for each customer in your list ?
Dec 1 '11 #2
nicodg
7
Hello Mihail,

Thansk for replying

First I have to refer to a previous topic: "How to save an Access report to pdf with filename based on fieldname" in which you can find som more details.

But resumed:
I need to send every month an account statement to each of our entities all over the world. Today's actionflow is:
- select customer nr from drop list ( 1 cust nr = 1 entity)
- click button which runs a code (first: filtering all information, from a global excel file, refering to the selected cust nr, Second: save output into pdf file by given it a specific name based on fieldname. (this works actually fine)

Question is:

just one click on a button, this will create an access report file considering all customer nr. Output in pdf file. But, if report shows 10 customer nr; then I need:
- 10 pdf file; one for each customer
- name of each pdf file must be/contain :"custumer nr" and "name"

Hope this will clarify a little more
Have a nice day
Dec 1 '11 #3
TheSmileyCoder
2,322 Expert Mod 2GB
This is where looping through a recordset comes in Handy.
Expand|Select|Wrap|Line Numbers
  1. Dim rsCustomers as Dao.Recordset
  2. Dim strSQL as String
  3. dim strReportName as string
  4.  
  5. strSQL="SELECT SAP,Cust,Hyperion " & _
  6.        "FROM [Hyperion accounts] " & _
  7.        "ORDER BY [SAP];"
  8. '(This may need to have a WHERE clause applied to it)
  9. set rsCustomers=CurrentDB.Openrecordset(strsql,dbopendynaset)
  10. Do while not rsCustomers.EOF 
  11.  strReportName = rsCustomers!Cust & "-" & rsCustomers!Hyperion & ".pdf"
  12.  DoCmd.OutputTo acOutputReport, "Rep Hyperion recon", acFormatPDF, myPath + strReportName, True 
  13.  rsCustomers.MoveNext
  14. Loop
  15.  
  16. 'Cleanup
  17. set rsCustomers=nothing
  18.  
This will print ALL your customers, so you need some way to specify which customers to print, I suppose it could be based on which customers have had orders this month, but I dont really have the details to specify such a where clause.
Dec 1 '11 #4
nicodg
7
Hello to all and sorry for this (very) late reply.
Once again I have received an answer to my problem
And once again it works fine...

thanks a lot for this great Forum
Dec 6 '11 #5
TheSmileyCoder
2,322 Expert Mod 2GB
Better late then never!

Good to see it worked for you.
Dec 6 '11 #6

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

Similar topics

1
by: Joris Kempen | last post by:
Hi people, I know that the question has come around sometimes: How to open an Access Report using ASP and export it to for example RTF. I'm trying to implement the first method of David...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
5
by: Steven Taylor | last post by:
Hope someone can help. I have an application whereby in order to create one document type I effectively print out 3 or 4 access reports in correct order. So the user goes to the printer,...
1
by: Brian Barnes | last post by:
I've been searching using google trying to find a way to display Access Reports via ASP.NET and only finding commericial products which appear to require that the report needs to be converted every...
1
by: David | last post by:
Does anyone know how to run MS Access reports from VB.net. I'd like to keep the existing reports in the database if I can. Thanks David
0
by: dkurtz | last post by:
D. Lesandrini published an article some time ago about exporting Access reports as XML, and then updating those XML reports dynamically in ..NET....
16
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report,...
1
by: NeoDeGenero | last post by:
I have a little VBA/Access - Reports problem and I’m not sure on how to approach it: I am trying to send a Report generated by MS Access via email through the command SendObject. ...
0
by: Qtip23 | last post by:
Hello All, So I have a my database information placed on a SharePoint site now that there is an immediate need for a web-based application in my division. I am able to print Access Reports...
3
by: shimul | last post by:
Hi All, I am trying to combine multiple access reports in one PDF using pdfcreator, however it doesn't work for me... Can you please check the following code: Sub...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.