Results 1 to 11 of 11

Thread: [RESOLVED] Last record not gettin printed(Crystal Report)

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2009
    Posts
    44

    Resolved [RESOLVED] Last record not gettin printed(Crystal Report)

    I have an issue that i dont know why i am facing. I have made a report which is working fine. Only problem is when that report is generated it displays 1 record less.

    I have done some calculations and stored the records in the database. From there i am directly getting the records. In print preview say it is showing 7 records but when report is generated using the form it displays only 6 records.

    Can anyone help me out??? I have attached the screenshots of both Print preview screen and actual report screen....
    Attached Images Attached Images   

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Last record not gettin printed(Crystal Report)

    The Report Header that shows only 6 records displays some dates. Why doesn't the Preview window show those dates?

    Are you using those dates in the record selection formula?

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2009
    Posts
    44

    Re: Last record not gettin printed(Crystal Report)

    well i dont think so that date would be relevant...What i am doing is all the data required for data is being stored in tmpstock table.
    Now for suppose 7 items ie i specify lower and upper limit of items on the form and the date..the query then fetches 7 records and stores in that temporary table. There in table it shows 7 records but while printing the table it shows only 6.

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2009
    Posts
    44

    Re: Last record not gettin printed(Crystal Report)

    Plz help me out...Its urgent.....
    What happens is when i load my project and print the report first time it show all records but all subsequent printing displays 1 record less.

    suppose i specify item number from 1 to 15, then first time it prints 15 records as needed but when again same report is generated it shows only 14 records..Is anyone having idea why is this happening???
    Last edited by mihirpatel83; Aug 25th, 2009 at 01:41 AM.

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2009
    Posts
    44

    Re: Last record not gettin printed(Crystal Report)

    Can anyone please help me out.???
    i created the whole report again bt still same problem.

    always the last records doesnt get printed of the lower and upperbound of records.???

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Last record not gettin printed(Crystal Report)

    Which version of Crystal are you using? If 8.5 or 9.0, upload the report file and I can take a look at it.

    Without seeing the code, database and report file I wouldn't know how to help you. I have never come across this type of problem.

    Posting the report file, database and a sample VB app that duplicates the problem would be best.

  7. #7

    Thread Starter
    Member
    Join Date
    Jul 2009
    Posts
    44

    Re: Last record not gettin printed(Crystal Report)

    I am using crystal report 8.5...

    In the attached DB.rar, i have provided the two reports in which i am facing such problem along with database and the VB form which calls those reports.

    i am storing the data in tmpstock table and from there i just have to dump those values in the reports but its not working. Evn when i tried to create a simple new report which had just 1 field in report from tmpstock table it showed 1 record less.

    Again would like to quote that when i print preview my report it shows data correctly, only the last record is not getting printed when the report is generated.
    Attached Files Attached Files
    • File Type: rar DB.rar (100.1 KB, 356 views)

  8. #8
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Last record not gettin printed(Crystal Report)

    MS Access uses "write caching" which means there is a slight delay before data is actually written to the database. The Connection that issued the insert (or update) statement can read back the new records immediately but other connections must wait until the delay time has passed before they can access the new record..

    In your case, because the report is executed right after the last record is written to the tmpStock table and since Crystal obviously uses a different connection than the VB form, that last record is not yet available for the report (it is still in the cache).

    One work around is to close the connection before executing the report. When a connection is closed, the "write cache" is flushed and any outstanding inserts/updates are immediately written to the database.

    Another option is to modify the default Flush Transaction Timeout property. Set this after you open your connection.

    db.Open "provider=..."
    db.Properties("Jet OLEDB:Flush Transaction Timeout") = 0
    The value of the property is in milliseconds.
    Last edited by brucevde; Aug 27th, 2009 at 12:49 AM.

  9. #9

    Thread Starter
    Member
    Join Date
    Jul 2009
    Posts
    44

    Re: Last record not gettin printed(Crystal Report)

    I am extremely thankful to you for helping me out. What all you told just worked out and thanks again for giving time and solution.
    Cheers!!!!

  10. #10

    Thread Starter
    Member
    Join Date
    Jul 2009
    Posts
    44

    Re: [RESOLVED] Last record not gettin printed(Crystal Report)

    I have a problem again with same report...

    What happens is now that data doest get refreshed from the report.
    Especially when i close the vb project and again open report, it shows the previous output of that report.
    After first time it shows data properly bt inbetween as well rarely i doesnt show the new data...

    What could be the possible reason.??
    It tried to close the connection and open it again....Stil it is not working. Following Code is executed when clicking on print button.



    db.Properties("Jet OLEDB:Flush Transaction Timeout") = 0
    Call frmLogin.GenerateDSN
    db.Properties("Jet OLEDB:Flush Transaction Timeout") = 0
    cr.DiscardSavedData = True
    cr.ReportFileName = App.Path & "\report\PartyLedger.rpt"
    cr.DiscardSavedData = True
    db.Properties("Jet OLEDB:Flush Transaction Timeout") = 0
    cr.Formulas(1) = "co_name= '" & DNAME & "'"
    db.Properties("Jet OLEDB:Flush Transaction Timeout") = 0
    cr.DiscardSavedData = True
    cr.Action = 1

  11. #11
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: [RESOLVED] Last record not gettin printed(Crystal Report)

    Dear Brucevd
    I also have same problem with VB6 & DataReport. Plz help.

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