| | |
Vb6 Data Report Repeatedly Shows Previous Report
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 8
Reputation:
Solved Threads: 0
plusplus,
Thanks for the reply. It didn't work but I caught the idea that the data environment which somehow does the caching of data needs to be updated.
I have been fiddling with the data outside the application using MS Access/VB6 Addins - Visual Data Manager directly. And even reset my PC or manually deletes the records in the table being pointed by the data environment, still the old report data gets retained.
After few days of playing around with all the properties of the data environment, the BEGIN TRANS, COMMIT TRANS and putting a PAUSE using a MSGBOX did the work:
---------------------------------------------------------
'*** Save all data on a daily basis and save to REPODETAILS table
StoreReportDetails dStartDate, dEndDate
'Summarizes data on a weekly basis and save to a REPOSUMMARY table.
StoreReportWeekSummary
'*** Environment using MSjet 4.0 OLE provider with
' SQL command:
' SELECT YearNr, monthnr, weeknr, tagnr, PigAge, pigtype,
' feedcode, feedname,heads, eachmealkg, totalcost,
' totalkg, bags FROM REPOSUMMARY
'------------------------------------------------------
Load dtaEnvPigs
With dtaEnvPigs
'***Two reports use this SUB, if isSumReport is true, DataReport1 gets printed.***
If Not isSumReport Then
'*** I don't need this trash anymore, unload it.
Unload dtaEnvPigs
Me.MousePointer = vbNormal
dtaRepoSum.Refresh
End Sub
Thanks for the reply. It didn't work but I caught the idea that the data environment which somehow does the caching of data needs to be updated.
I have been fiddling with the data outside the application using MS Access/VB6 Addins - Visual Data Manager directly. And even reset my PC or manually deletes the records in the table being pointed by the data environment, still the old report data gets retained.
After few days of playing around with all the properties of the data environment, the BEGIN TRANS, COMMIT TRANS and putting a PAUSE using a MSGBOX did the work:
---------------------------------------------------------
'*** Save all data on a daily basis and save to REPODETAILS table
StoreReportDetails dStartDate, dEndDate
'Summarizes data on a weekly basis and save to a REPOSUMMARY table.
StoreReportWeekSummary
'*** Environment using MSjet 4.0 OLE provider with
' SQL command:
' SELECT YearNr, monthnr, weeknr, tagnr, PigAge, pigtype,
' feedcode, feedname,heads, eachmealkg, totalcost,
' totalkg, bags FROM REPOSUMMARY
'------------------------------------------------------
Load dtaEnvPigs
With dtaEnvPigs
End With
'*** Open the dta environment, to prepare begintrans
If .RepoSummary.State = 0 Then.RepoSummary.OpenEnd If
'*** Force saving of data by committing transactions
dtaEnvPigs.RepoSummary.BeginTrans
dtaEnvPigs.RepoSummary.CommitTrans
'*** Close the environment after loading***
dtaEnvPigs.RepoSummary.Close
'*** Give the provider sufficient delay time to commit trans.
If MsgBox("Press Ok to continue.", vbOKCancel, "Options") = vbCancel ThenExit SubEnd If
'***Two reports use this SUB, if isSumReport is true, DataReport1 gets printed.***
If Not isSumReport Then
DataReport1.LeftMargin = 200Else
DataReport1.ReportWidth = 8865
DataReport1.Width = 9100
DataReport1.Title = IIf(isDiscounted, "Discounted", " ")
If DataReport1.Visible = False Then
DataReport1.Show 1
DataReport4.LeftMargin = 200End If
DataReport4.ReportWidth = 8865
DataReport4.Width = 9100
If DataReport4.Visible = False Then DataReport4.Show
'*** I don't need this trash anymore, unload it.
Unload dtaEnvPigs
Me.MousePointer = vbNormal
dtaRepoSum.Refresh
End Sub
Last edited by genie_ps; Aug 22nd, 2007 at 9:30 pm.
•
•
Join Date: Mar 2008
Posts: 1
Reputation:
Solved Threads: 0
Just ran across your post looking for help on something similar.
Have you cleared the 'save old data with report' box on the report file itself?
Open the report, under File // Report Options
there will be a checkbox for "Save Data With Report". If it is checked, uncheck it and see if that fixes the issue.
Thansk
klheitz
Have you cleared the 'save old data with report' box on the report file itself?
Open the report, under File // Report Options
there will be a checkbox for "Save Data With Report". If it is checked, uncheck it and see if that fixes the issue.
Thansk
klheitz
![]() |
Similar Threads
- How add Crystal Report Version 11 in VB6 (Visual Basic 4 / 5 / 6)
- Data Report in vb 6.0 (Visual Basic 4 / 5 / 6)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- problem connection vb6 & crystal report 11 (Visual Basic 4 / 5 / 6)
- ASP.NET Crystal Report ODBC MySQL (ASP.NET)
- Crystal report (VB.NET)
- Help in understanding Adwords conversion tracking report (Search Engine Optimization)
- Trouble positioning report type of page (HTML and CSS)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: get file name but NOT with the common dialog option
- Next Thread: MSFlexgrid Click event
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





