dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: DataReport problems... help!!

  1. #1
    Pat Stevens Guest

    DataReport problems... help!!



    I am running a data report with the following code:

    Dim rs As New Recordset
    Set rs = FccsDB.Execute("SELECT * FROM RADIO_UNIT_ASSIGNMENT WHERE CURRENT_ASSIGNMENT_IND
    = 'Y' ORDER BY RADIO_UNIT_ID")


    ' Connect the Recordset to the DataReport.
    Set DataReport1.DataSource = rs

    DataReport1.ExportReport rptKeyText, FileName:="C:\Temp\DailyRpt.txt",
    overwrite:=True, showdialog:=False, range:=rptRangeAllPages

    end

    ---> now the program looks like it runs fine, but only the first page of
    data is saved in the DailyRpt.txt file. strangely enough, when i put a
    MsgBox for the user to click on in the middle of the program, it works fine.
    it seems like it needs a pause to collect itself or something. why is it
    rushing to the END command before loading all of the data?

    i've been putting random breaks in the DataReport events. but only a MsgBox
    will make it so all of the data goes to the file. It works the same way
    for DataReport.Show. The report won't even show unless i somehow prompt
    for user input.

    Can anyone help? What is the problem here?

    thanks

    Pat

  2. #2
    Duane Snelling Guest

    Re: DataReport problems... help!!


    Pat,
    Try using DoEvents instead of the msgbox. I ran into the same problem before,
    and that worked. It should complete the processes before continuing to run
    on.

    Hope this helps

    Duane...

    "Pat Stevens" <pstevens@ita.cityofla.org> wrote:
    >
    >
    >I am running a data report with the following code:
    >
    > Dim rs As New Recordset
    > Set rs = FccsDB.Execute("SELECT * FROM RADIO_UNIT_ASSIGNMENT WHERE

    CURRENT_ASSIGNMENT_IND
    >= 'Y' ORDER BY RADIO_UNIT_ID")
    >
    >
    > ' Connect the Recordset to the DataReport.
    > Set DataReport1.DataSource = rs
    >
    > DataReport1.ExportReport rptKeyText, FileName:="C:\Temp\DailyRpt.txt",
    >overwrite:=True, showdialog:=False, range:=rptRangeAllPages
    >
    >end
    >
    >---> now the program looks like it runs fine, but only the first page of
    >data is saved in the DailyRpt.txt file. strangely enough, when i put a


    > MsgBox for the user to click on in the middle of the program, it works

    fine.
    > it seems like it needs a pause to collect itself or something. why is

    it
    >rushing to the END command before loading all of the data?
    >
    >i've been putting random breaks in the DataReport events. but only a MsgBox
    >will make it so all of the data goes to the file. It works the same way
    >for DataReport.Show. The report won't even show unless i somehow prompt
    >for user input.
    >
    >Can anyone help? What is the problem here?
    >
    >thanks
    >
    >Pat



  3. #3
    Kevin Guest

    Re: DataReport problems... help!!


    Per Microsoft Premier Support: try the following code, it worked for me:

    datareport1.print
    While datareport1.asynccount > 0
    DoEvents
    Wend
    datareport2.print

    Hope this helps!
    Kevin

    "Duane Snelling" <dsnelling@msc.ca> wrote:
    >
    >Pat,
    >Try using DoEvents instead of the msgbox. I ran into the same problem before,
    >and that worked. It should complete the processes before continuing to

    run
    >on.
    >
    >Hope this helps
    >
    >Duane...
    >
    >"Pat Stevens" <pstevens@ita.cityofla.org> wrote:
    >>
    >>
    >>I am running a data report with the following code:
    >>
    >> Dim rs As New Recordset
    >> Set rs = FccsDB.Execute("SELECT * FROM RADIO_UNIT_ASSIGNMENT WHERE

    >CURRENT_ASSIGNMENT_IND
    >>= 'Y' ORDER BY RADIO_UNIT_ID")
    >>
    >>
    >> ' Connect the Recordset to the DataReport.
    >> Set DataReport1.DataSource = rs
    >>
    >> DataReport1.ExportReport rptKeyText, FileName:="C:\Temp\DailyRpt.txt",
    >>overwrite:=True, showdialog:=False, range:=rptRangeAllPages
    >>
    >>end
    >>
    >>---> now the program looks like it runs fine, but only the first page

    of
    >>data is saved in the DailyRpt.txt file. strangely enough, when i put a

    >
    >> MsgBox for the user to click on in the middle of the program, it works

    >fine.
    >> it seems like it needs a pause to collect itself or something. why is

    >it
    >>rushing to the END command before loading all of the data?
    >>
    >>i've been putting random breaks in the DataReport events. but only a MsgBox
    >>will make it so all of the data goes to the file. It works the same way
    >>for DataReport.Show. The report won't even show unless i somehow prompt
    >>for user input.
    >>
    >>Can anyone help? What is the problem here?
    >>
    >>thanks
    >>
    >>Pat

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center