Re: Export to RTF very slow when code is present in Access report.

Discussion in 'Microsoft Access Reports' started by Dale Dixon [MSFT], Sep 3, 2004.

  1. Hi Ryan,

    My name is Dale and I'm reveiwing your issue:

    I attempted to make this response earlier this week but messed it up. This
    should work better.

    ISSUE:

    =====

    Export to RTF very slow when code is present in Access report.

    Occurs with reports with 200-600 pages

    ENVIRONMENT

    ===========

    Access 2003

    Widows 2000 or XP.

    STEPS TAKEN

    ==============

    1. Simple code in the Detail_Format event of a report: displays or hides

    certain text boxes.

    2. Report is exported to Word it hangs for 2.5 minutes displaying the Now

    outputting window but output to RTF begins.

    3. Preview the report with the code still in detail section - Displays

    normal

    4. If code is commented out , output to RTF works fine.

    5. A breakpoint is placed in the Detail_Format event and it didn't break

    during outputting to RTF

    Appears that items 2 and 5 are issues to address at this point: the report

    hanging during the output operation and the fact that putting a breakpoint

    in his code does not break during execution of the output to RTF operation.

    STEPS TO TAKE

    ============

    1. Need to gather more specific information about the environment, such as:

    - Service packs and versions of applications like Word.

    - Versions of Jet, MDAC

    - Need to determine if this can be reproduced in the Northwind sample

    database or similar database

    2. It will be a good idea to provide the specific steps to reproduce the

    issue in a similar environment.

    3. If its possible please provide sample code, or a sample database with a

    report which displays this behavior.

    - specific fields

    - specific code used in detail section

    - specific data used in the report

    - specific configuration of database and system when issue occurs

    NOTES

    =====

    The breakpoints being ignored may be attributed to the issue addressed in

    the following article:

    ACC2000: Breakpoints Are Ignored in Visual Basic for Applications Code

    (296848)

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;296848

    NEXT STEPS

    =========

    Ryan if its possible for you to provide specific repro steps and a sample

    database that would be great for me to troubleshoot here also. Also Ryan

    please review the informtion above and let me know if this correct.

    Thanks

    Dale

    <> wrote in message
    news:...
    >I am using the following code, as a test example, in the report:
    > ----------------------------------------------------
    > Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    > If Report_ReportonqryNotPassThrough!txtFirstName.Value = "sdf" Then
    > Report_ReportonqryNotPassThrough!txtFirstName.Visible = True
    > Report_ReportonqryNotPassThrough!txtBoldFirstName.Visible = False
    > Report_ReportonqryNotPassThrough!txtLastName.Visible = True
    > Report_ReportonqryNotPassThrough!txtBoldLastName.Visible = False
    > Else
    > Report_ReportonqryNotPassThrough!txtFirstName.Visible = False
    > Report_ReportonqryNotPassThrough!txtBoldFirstName.Visible = True
    > Report_ReportonqryNotPassThrough!txtLastName.Visible = False
    > Report_ReportonqryNotPassThrough!txtBoldLastName.Visible = True
    > End If
    > End Sub
    > ---------------------------------------------------
    > I have the report based on a table with 3 fields and 10,000 rows.
    >
    > The code works fine when I preview the report. When I export to Word it
    > will "hang" at outputting... for 2.5 minutes and then begin outputting
    > page
    > 1, 2, ...
    >
    > If I comment out the code AFTER I have already opened it in Preview mode
    > it
    > will begin outputting page 1,2,... immediately.
    >
    > I included a Stop command in the code and when I output to Word it never
    > breaks to the code leading me to believe the code never runs during the
    > output to Word. If the code never runs why is there such a delay when the
    > code is there?
    >
    > Ryan
    >
    > "Vikrant V Dalwale [MSFT]" wrote:
    >
    >>
    >>
    >> Hello Ryan,
    >>
    >> I would appreciate your patience while I am having tech experts look
    >> into
    >> this issue.
    >>
    >> Thanks for using MSDN Managed Newsgroup.
    >>
    >> Vikrant Dalwale
    >>
    >> Microsoft SQL Server Support Professional
    >>
    >>
    >> Microsoft highly recommends to all of our customers that they visit the
    >> http://www.microsoft.com/protect site and perform the three
    >> straightforward
    >> steps listed to improve your computer's security.
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >> --------------------
    >> >Thread-Topic: Export to RTF very slow when code is present in Access

    >> report.
    >> >thread-index: AcSJ7tC6+pF1b2QHTKqoZGtsXszArQ==
    >> >X-WBNR-Posting-Host: 156.153.255.134
    >> >From: "=?Utf-8?B?UnlhbkBuZXdzZ3JvdXBzLm5vc3BhbQ==?="

    >> <>
    >> >Subject: Export to RTF very slow when code is present in Access report.
    >> >Date: Tue, 24 Aug 2004 08:27:07 -0700
    >> >Lines: 20
    >> >Message-ID: <>
    >> >MIME-Version: 1.0
    >> >Content-Type: text/plain;
    >> > charset="Utf-8"
    >> >Content-Transfer-Encoding: 7bit
    >> >X-Newsreader: Microsoft CDO for Windows 2000
    >> >Content-Class: urn:content-classes:message
    >> >Importance: normal
    >> >Priority: normal
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >> >Newsgroups: microsoft.public.access.reports
    >> >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >> >Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >> >Xref: cpmsftngxa10.phx.gbl microsoft.public.access.reports:145104
    >> >X-Tomcat-NG: microsoft.public.access.reports
    >> >
    >> >I have seen this happen with reports anywhere from 200-600 pages in
    >> >Access
    >> >2003 running on Windows 2000 or XP.
    >> >
    >> >I have some simple code in the Detail_Format event of a report that
    >> >either
    >> >displays or hides certain text boxes.
    >> >
    >> >When I export the report to Word it hangs for 2.5 minutes on the Now
    >> >outputting...
    >> >window and then finally it will begin to output to RTF.
    >> >
    >> >If I preview the report with the code still there the report comes up
    >> >fine
    >> >as normal and then if I comment out the code it will output to RTF just

    >> fine.
    >> > I put a breakpoint in the Detail_Format event and it didn't even break

    >> when
    >> >outputting to RTF so I can't imagine why the code would cause it to have

    >> such
    >> >a delay.
    >> >
    >> >Any ideas?
    >> >
    >> >Ryan
    >> >
    >> >

    >>
    >>
     
    Dale Dixon [MSFT], Sep 3, 2004
    #1
    1. Advertisements

  2. Dale Dixon [MSFT]

    Dale Dixon Guest

    Hi Ryan,

    I did receive your information, thanks for the information I will use it to
    reproduce your issue,
    I'm presently attempting to repro and will provide feedback 09/07/2004 on
    my results.

    Dale
     
    Dale Dixon, Sep 6, 2004
    #2
    1. Advertisements

  3. Dale Dixon [MSFT]

    Dale Dixon Guest

    Hi Ryan

    I'm listing below a sample of a test I performed based on the information
    you provided:

    Created a sample database with the following fields in a table:
    * txtFirstName Text 50
    * txtLastName Text 50
    * txtBoldFirstName Text 50
    * Attempts made with 14,000 plus and 10,000 records same results.

    Created 2 reports to test :

    1. OnPrint code added to the report detail section of the sample Report
    =========================================
    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    If Reports!rpt3!txtFirstName.Value = "Nancy" Then
    Reports!rpt3!txtFirstName.Visible = True
    Reports!rpt3!txtBoldFirstName.Visible = False
    Reports!rpt3!txtLastName.Visible = True
    Reports!rpt3!txtBoldLastName.Visible = False
    Else
    Reports!rpt3!txtFirstName.Visible = False
    Reports!rpt3!txtBoldFirstName.Visible = True
    Reports!rpt3!txtLastName.Visible = False
    Reports!rpt3!txtBoldLastName.Visible = True
    End If
    End Sub

    RESULTS
    ======
    * preview of the report was satisfactory
    * export to .rtf was satisfactory
    * publish it to Microsoft Word was satisfactory.

    2. OnFormat code added to the report detail section

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Reports!rpt3Flds!txtFirstName.Value = "Nancy" Then
    Reports!rpt3Flds!txtFirstName.Visible = True
    Reports!rpt3Flds!txtBoldFirstName.Visible = False
    Reports!rpt3Flds!txtLastName.Visible = True
    Reports!rpt3Flds!txtBoldLastName.Visible = False
    Else
    Reports!rpt3Flds!txtFirstName.Visible = False
    Reports!rpt3Flds!txtBoldFirstName.Visible = True
    Reports!rpt3Flds!txtLastName.Visible = False
    Reports!rpt3Flds!txtBoldLastName.Visible = True
    End If

    End Sub

    RESULTS
    ======
    * preview of the report was satisfactory
    * export to .rtf was satisfactory
    * publish it to Microsoft Word received overflow error. once but continued
    satisfacatory

    Next Steps
    =======
    Ryan could you verify that the test performed are the steps you are also
    taking also:
    1. See if moving the code to the OnPrint property display the same results
    2. Let me know if export to .rtf is what you are accomplishing or are you
    using publish it to word in Office links.

    Thanks
    ddixon
     
    Dale Dixon, Sep 9, 2004
    #3
  4. Dale Dixon [MSFT]

    Dale Dixon Guest

    Hi Ryan,

    Thanks for the update, the possible solution provided was one based on
    previous related issues which have been reported , related to code and
    calculations in the reports format event.

    You state that the print event works sufficiently, however would like to
    know why the fomat event appears "checked". I'm not exactly sure I know
    what you mean by appearing checked. Could you let me know what is the exact
    display which indicates that the format event is checked and I will respond
    to your question.

    Thanks.

    Dale
     
    Dale Dixon, Sep 10, 2004
    #4
  5. Dale Dixon [MSFT]

    Guest Guest

    Dale,

    Quick Example:
    If I remove all code from the report and preview the report, the report of
    course opens fine.
    Then if I switch to VB Editor still with the report open and add this code:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Stop
    End Sub

    when I switch back to the report and click the Microsoft Word button on the
    OfficeLinks toolbar I get the Now Outputting window but it does not list any
    page numbers yet. After about 2.5 minutes it begins to say Now Outputting
    page 1,2,etc.

    The reason I say it appears "checked" is because I put the Stop command in
    there but the code never breaks when outputting to Word. If I delete out the
    above 3 lines of code it exports to Word right away.

    Granted, this is running on a 450 MHz machine so you may not see what I am
    talking about.

    To recap: If the detail_format event exists, there is a large delay
    outputting to word, even if there is not code in the event.

    Ryan

    "Dale Dixon" wrote:

    > Hi Ryan,
    >
    > Thanks for the update, the possible solution provided was one based on
    > previous related issues which have been reported , related to code and
    > calculations in the reports format event.
    >
    > You state that the print event works sufficiently, however would like to
    > know why the fomat event appears "checked". I'm not exactly sure I know
    > what you mean by appearing checked. Could you let me know what is the exact
    > display which indicates that the format event is checked and I will respond
    > to your question.
    >
    > Thanks.
    >
    > Dale
    >
    >
     
    Guest, Sep 11, 2004
    #5
  6. Dale Dixon [MSFT]

    Dale Dixon Guest

    Hi Ryan

    I could not duplicate customer your concern with the "stop" comand placed
    in code
    1. I was able to place the stop command in code
    2. I was able to successfully execute .rtf in both scenerios without issue.

    Ryan it is very possible that theissue with the stop command may be because
    of your environment, you might want to test in different environments you
    may need to increase any number of items in his environment but I could not
    be duplicated on a computer in an environment as listed below:

    Windows XP SP2
    Access 2003
    P4 2.6 Ghz
    1.0 gb RAM

    Dale
     
    Dale Dixon, Sep 14, 2004
    #6
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Rolfe

    Access crashes when attempting RTF export from report

    Alan Rolfe, Nov 3, 2003, in forum: Microsoft Access Reports
    Replies:
    2
    Views:
    365
    Alan Rolfe
    Nov 6, 2003
  2. Mejrin

    Export a report from MS access to Word or rtf

    Mejrin, Jan 10, 2004, in forum: Microsoft Access Reports
    Replies:
    0
    Views:
    232
    Mejrin
    Jan 10, 2004
  3. ix45

    export a report from MS access to Word or rtf

    ix45, Jan 10, 2004, in forum: Microsoft Access Reports
    Replies:
    0
    Views:
    259
  4. Jay

    Export Access Report to .RTF format problem

    Jay, Feb 18, 2004, in forum: Microsoft Access Reports
    Replies:
    3
    Views:
    1,034
    Jim/Chris
    Feb 18, 2004
  5. Bas van der Doorn
    Replies:
    1
    Views:
    268
    Stephen Lebans
    Jul 29, 2004
Loading...

Share This Page