CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Location
    Jordan
    Posts
    30

    Report ciew correct but print no

    Hi,
    first
    Program language visual basic 6 +SP5
    Crystal Report 8.5
    SQL Server2000

    Day2(Namr of report)

    the problem
    i use these code so when any one click print in report view he can select the printer

    UseDefault = False
    Day2.PrinterSetup Me.hwnd
    Day2.PrintOut True

    first time view report its print ok but if i open report again with differnet parameters its showing correct data in report view but after i click print and choose printer it still print the first report

    why these happen?

  2. #2
    Join Date
    Oct 2004
    Location
    Adelaide, South Australia
    Posts
    125

    Re: Report ciew correct but print no

    I've seen this problem before, a few years ago.
    I don't work at the same place now, so I can't go back into SourceSafe and check the code, but I seem to recall we had this problem due to originally not properly disposing of the report object.
    If you have a report object open (instantiated) and you then reset some parameters, it may not function properly unless you dispose of the object when you next start a "view" process.
    So, when you click on a button to regenerate your view of the report, make sure you do something like this;

    set objReport = Nothing
    set objParams = Nothing

    and then provide code to recreate the objects, which should flush the report object and all objects is has created, and then create a clean new object so you can set parameters.

    Dave
    'shut up and play yer guitar' - Frank Zappa

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

Featured