Results 1 to 9 of 9

Thread: Refrech Data Report

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Malaysia
    Posts
    13

    Refrech Data Report

    I face a problem where for the first time I display my report all it was alright but after I went back and add some records to my database, I went back to show again the reports and it seem that same like previous one where the change no effect on it. It only take changed when I close the form few time or close the program and open it again. How do I make the report refresh or updated first before is display the records from the table ???





    shinyo21

  2. #2
    New Member
    Join Date
    Jul 2003
    Location
    Philippines
    Posts
    9
    Try to unload dataenvironment and set it nothing in the datareport_queryclose event.

    I had this same problem before and what i did is unload the data environment and set it to nothing in the datareport queryclose event and it works fine for me.

    Hope this works for you.


  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Malaysia
    Posts
    13

    Unhappy

    I tried it already, but seem that the output same , i still need to close the report and open it again only it show the latest updated records. ..... BUT I found one thing little bit funny ..where although the data was not updated, but the function which i used it for total all the records was update only the detail records was not update. Do anyone have any idea what is going ON???? ???




    shinyo21

  4. #4
    Fanatic Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    855
    Try in queryclose event:
    dataenvironment1.rsCommand1.Close

    or, another way:
    Private Sub Command1_Click()
    If DataEnvironment1.rsCommand1.State = adStateOpen Then DataEnvironment1.rsCommand1.Close

    'reopen the command
    DataEnvironment1.Command1

    DataReport1.Show
    'allows a refresh with new data without having to close the report first.
    DataReport1.Refresh
    End Sub
    VB 6.0, Access, Sql server, Asp

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Malaysia
    Posts
    13
    I really don't get it, it still dun work. Do it any things relation with the command and child command ???? Actually the record I have been moved out is came from the child command there, example I means child command is >>

    ==============================================
    DataEnviroment >> Connection >> Command >> Child Command
    ==============================================

    The sumFunctioin I was using the Command(OriTable) to display it out and where by the Child Command I used it for displaying the transaction records. It there any error mistake I had done with it ????
    I found that maybe an error because when I test only moving the first command(Ori Table)'s records without adding any child command' records transaction. It was all alright....actually what is the problem ???? Please any one help me !!!!



    shinyo21

  6. #6
    Lively Member
    Join Date
    Dec 2001
    Location
    South Africa
    Posts
    88
    Remember you Datareport is binded to some Recordset data, you must first Requery the recordset and then after you can refresh the DataReport.

    In you case you Data comes from DE, try and refresh the DE first then you DataReport.

    Regards

    Wizard
    SA

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Location
    Malaysia
    Posts
    13

    Unhappy

    I really sorry, do u have any sample command as what as mention ? I am quite dummy and not quite understand ....





    shinyo21

  8. #8
    Junior Member
    Join Date
    Jan 2006
    Posts
    23

    Re: Refrech Data Report

    Quote Originally Posted by shinyo21
    I face a problem where for the first time I display my report all it was alright but after I went back and add some records to my database, I went back to show again the reports and it seem that same like previous one where the change no effect on it. It only take changed when I close the form few time or close the program and open it again. How do I make the report refresh or updated first before is display the records from the table ???





    shinyo21
    dear shiny,
    do as follows...

    on a commandbutton write this code:
    ---------------------------------
    unload dataenvironment1
    datareport1.show
    ----------------------------------
    this will first unload the dataenvironment and automatically reload. Hence this will refresh the datareport and you will get all newly added records in it. OK?

  9. #9
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Refrech Data Report

    Quote Originally Posted by sunilmaloo2003
    dear shiny,
    do as follows...

    on a commandbutton write this code:
    ---------------------------------
    unload dataenvironment1
    datareport1.show
    ----------------------------------
    this will first unload the dataenvironment and automatically reload. Hence this will refresh the datareport and you will get all newly added records in it. OK?
    Are you aware that the thread you are replying to is from year 2003? Anyway, welcome to VBF!
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width