I'm modifying a VB application which calls the Crystal Report viewer. The VB was written to display one report at a time. If you wanted to run two reports, you would have to close out of the program and get back into it to run the 2nd report.
I am trying to allow the VB program to not have to be closed to be able to run the Crystal viewer for a 2nd time. However, I'm running into problems.
The main code I am using is below:
mainjob = PEOpenPrintJob(sfullpath & vbNullChar)
result = PEOutputToWindow(mainjob, "Crystal Reports Preview" & Chr$(0), CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, WS_VISIBLE + WS_CAPTION + WS_BORDER + WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX + _
WS_MAXIMIZEBOX, 0)
result = PEStartPrintJob(mainjob, True)
During the 1st iteration the field 'mainjob' gets assigned the value '1'. This works perfectly. The 2nd iteration, mainjob is set to '2'. When the last line is run, the CR viewer flashes but doesn't stay or display any information.
I attemted to use the PEClosePrintJob and PECancelPrintJob functions, but these didn't appear to help as mainjob was still set to '2' on the 2nd iteration.
Any thoughts/solutions on this dilemma would be very appreciated!
I am trying to allow the VB program to not have to be closed to be able to run the Crystal viewer for a 2nd time. However, I'm running into problems.
The main code I am using is below:
mainjob = PEOpenPrintJob(sfullpath & vbNullChar)
result = PEOutputToWindow(mainjob, "Crystal Reports Preview" & Chr$(0), CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, WS_VISIBLE + WS_CAPTION + WS_BORDER + WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX + _
WS_MAXIMIZEBOX, 0)
result = PEStartPrintJob(mainjob, True)
During the 1st iteration the field 'mainjob' gets assigned the value '1'. This works perfectly. The 2nd iteration, mainjob is set to '2'. When the last line is run, the CR viewer flashes but doesn't stay or display any information.
I attemted to use the PEClosePrintJob and PECancelPrintJob functions, but these didn't appear to help as mainjob was still set to '2' on the 2nd iteration.
Any thoughts/solutions on this dilemma would be very appreciated!