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

Check if Report is fully formatted

We have Order DB in Access where we collect and send Order confirmation to Clients. In Order Form I click button to open Confirmation Report in Normal view. I have "Send Report" button on opened report to send it to Client in PDF format.

All works grate with small reports. Problem arrise when report has 15-20 or more pages. After some investigation I found out that at time of report load user press Send button and report simply not being fully formated and sending action just fails.

I cannot find correct event to check if report is finished formatting. It would help me to make Send button enabled true/false based on that status.
Dec 2 '14 #1
7 1264
twinnyfo
3,653 Expert Mod 2GB
litpost,

I'm not sure I understand either your question or your request. When a report is displayed in Access, it will format itself as you view consecutive pages.

However, from what I understand, when you export a report to PDF, the entire report is generated using the Adobe drivers. Whether you use either of these two methods:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, "ReportName", acFormatPDF, "FileName"
  2.  
  3. or 
  4.  
  5. DoCmd.SendObject , "ReportName", acFormatPDF, "EMailAddress"
It has nothing to do with the display of the report.

Are you able to determine exactly at what point the reports begin to cause problems? Is it at Page 8 or 9 or some other page number? Or is it only when reports have certain types of fields (or memo fields)? Sometimes, memo fields can cause headaches on reports.
Dec 2 '14 #2
jforbes
1,107 Expert 1GB
This might work for you. I haven't tried it:
Expand|Select|Wrap|Line Numbers
  1. If Not Application.CurrentProject.AllReports("YourReportName").IsLoaded Then
  2.     DoCmd.OpenReport "YourReportName", acViewPreview, , "YourWhereClause"
  3. End If
  4. DoCmd.OutputTo acOutputReport, "YourReportName", acFormatPDF, "OutputDestination", True
Another thing to consider is to put all the code to make the PDF into one button that way the Preview and the call to Output to PDF are on the same thread.
Dec 2 '14 #3
jimatqsi
1,271 Expert 1GB
litpost,
I've had lots of problems with emailing PDFs that took more time to be saved to disk than I allowed. I used the Bullzip PDF driver to create my PDFs because a lot of my work is in Access 2003. There are better options now but probably the same issue exists.

I've had to build in pauses, sometimes long pauses, or a loop that keeps looking for the file to exist before trying to send the email with the PDF attached. When I'm creating multiple reports to send, I've found it's best to create all the reports first and then send all the emails.

My experience may or may not apply to your case. What does your code look like?

Jim
Dec 2 '14 #4
We have "Send" button on Confirmation Report. Report loads in acNormal view and sometimes it takes couple of seconds. To send report I use
Expand|Select|Wrap|Line Numbers
  1. docmd.sendObject
If some non-patient user hits "Send" button before Report finishes to load it brings them error. I need to freeze "Send" button until report is fully loaded/formatted.

Jim, I had similar idea first to save PDF file on disk and after send it. But I doubt it solves my issue because anyway Output must be finished before sending. How shall I control this? Using Timer is not very good way as some reports load immediately and for others it takes 5-15 or even more seconds.
Dec 2 '14 #5
zmbd
5,501 Expert Mod 4TB
in your code have you set a Trap for error?
Dec 2 '14 #6
Yes, I have. I can trap error and maybe someway retry sendObject row. Its one of solutions, however, not the best.

Another solution maybe with timer help.
Here I have question: when exactly Report ontimer event starts?
Dec 3 '14 #7
I solved it at last.

- switched on docmd.Hourglass before button which opens the Report (button is located on Order Form) and switched off docmd.Hourglass on exit sub.

- in OnClick event of "Send" button at the top did the check for MousePointer

Expand|Select|Wrap|Line Numbers
  1. If Screen.MousePointer = 11 Then Exit Sub
Now User is not able to start sending until all process of button on Order Form is finished. That is actualy strange but somehow it solved the issue. Thank you all for help!
Dec 3 '14 #8

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

Similar topics

0
by: elmo | last post by:
Hi, I have a VB 6 application running of SQL2000. All reports generated from the app is done in Crystal and then exported as well. My problem is that I need to created a free flow type report...
3
by: Joanna Epstein | last post by:
I have several tables formatted as follows: ITEM #, ITEM DESCRIPTION, PL, JANUARY ITEM #, ITEM DESCRIPTION, PL, FEBRUARY And so on… I need to create a final report that merges all of the...
1
by: AstronusX | last post by:
Hi, I'm looking for good printing/reporting tool that customize base on user need, like add more columns to report(design at run-time) for the products that we make? Any recommendation?? Thank...
1
by: Louise | last post by:
I am creating a database that will provide a report that tells the user how many units of each part number is on hand. At present I have a table that contains present stock, and all the present...
3
by: pv1 | last post by:
Hello, I am somewhat new to Access and vba, but am trying to complete a request that has been made of me. Access version 2002 WindowsXP. At this point these text boxes are bound to the table...
6
by: Fresco | last post by:
Using Access 97, how do I avoid printing multiple copies of a check when the subreports used for the check stubs have multiple records (like when I want to pay several invoices with one check)? If I...
0
by: Kumba | last post by:
Hi all, Working on a pretty fancy access report that prints out a schedule of events in a two-column format, I've stumbled across the need for displaying formatted text into a field. Since I'm...
1
by: meha | last post by:
my sql datbase base in this format-- id of employee,, name of employee,, daily date,, and status= absent or present or weekly off(wo) --------------------------------------------------------- id...
3
by: Becker | last post by:
I have the following code to save a report as a pdf, email it as an attachment and then delete the pdf. It works fine. Dim iCfg As Object Dim iMsg As Object Set iCfg =...
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?
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.