Skip to main content

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
You don't specify what version you have tried this with, there used to be some anomalities with the .def file generator in version 5.2.x, you might want to give it a try with a .def file generated by a 6.0 version of AxDefGen to see if it makes a difference.

Also, make sure you are using the primary interfaces were available, not the secondary, as you then might loose relationships between the classes.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
You don't specify what version you have tried this with, there used to be some anomalities with the .def file generator in version 5.2.x, you might want to give it a try with a .def file generated by a 6.0 version of AxDefGen to see if it makes a difference.

Also, make sure you are using the primary interfaces were available, not the secondary, as you then might loose relationships between the classes.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
You don't specify what version you have tried this with, there used to be some anomalities with the .def file generator in version 5.2.x, you might want to give it a try with a .def file generated by a 6.0 version of AxDefGen to see if it makes a difference.

Also, make sure you are using the primary interfaces were available, not the secondary, as you then might loose relationships between the classes.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
I had originally generated my def files with the 5.2.1 version of AxDefGen. I re-generated with 6.0.0 AxDefGen as you suggested and it's working fine now.

Thanks.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
When you say to make sure that I am using the primary interfaces where available, how would I do that?

My problem has mostly been solved, but now I have another issue where I am using the Microsoft MonthView control to display a pop-up calendar that the user can select a date from. If the users pop-up this calendar and then print a crystal report using the RDC, the program stops responding when I execute a MODIFY CRYSTAL-RPT @ReadRecords() statement. I don't see how the two controls would be clashing with each other, but the problem only occurs if the MonthView pop-up is selected before printing the report.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
When you say to make sure that I am using the primary interfaces where available, how would I do that?

My problem has mostly been solved, but now I have another issue where I am using the Microsoft MonthView control to display a pop-up calendar that the user can select a date from. If the users pop-up this calendar and then print a crystal report using the RDC, the program stops responding when I execute a MODIFY CRYSTAL-RPT @ReadRecords() statement. I don't see how the two controls would be clashing with each other, but the problem only occurs if the MonthView pop-up is selected before printing the report.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
Originally posted by JGramer
When you say to make sure that I am using the primary interfaces where available, how would I do that?


If you look in the definition file, you can search for the phrase:

PRIMARY-INTERFACE


The instance that has this phrase in its CLASS definition, is the primary interface. There will be only one of those per component. Remember though, that one single def file may have multiple components, thus possibly multiple primary interfaces.


My problem has mostly been solved, but now I have another issue where I am using the Microsoft MonthView control to ...


This is difficult to determine, I'd suggest you try to create as small a reproducable as possible and contact Tech support for this.

Are you executing the command inside an event?

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
Originally posted by JGramer
When you say to make sure that I am using the primary interfaces where available, how would I do that?


If you look in the definition file, you can search for the phrase:

PRIMARY-INTERFACE


The instance that has this phrase in its CLASS definition, is the primary interface. There will be only one of those per component. Remember though, that one single def file may have multiple components, thus possibly multiple primary interfaces.


My problem has mostly been solved, but now I have another issue where I am using the Microsoft MonthView control to ...


This is difficult to determine, I'd suggest you try to create as small a reproducable as possible and contact Tech support for this.

Are you executing the command inside an event?

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
Originally posted by JGramer
When you say to make sure that I am using the primary interfaces where available, how would I do that?


If you look in the definition file, you can search for the phrase:

PRIMARY-INTERFACE


The instance that has this phrase in its CLASS definition, is the primary interface. There will be only one of those per component. Remember though, that one single def file may have multiple components, thus possibly multiple primary interfaces.


My problem has mostly been solved, but now I have another issue where I am using the Microsoft MonthView control to ...


This is difficult to determine, I'd suggest you try to create as small a reproducable as possible and contact Tech support for this.

Are you executing the command inside an event?

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
I have a problem with your sample

COPY RESOURCE "CRV9.def".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV9v7.def"
GIVING ActiveX-Res.
DISPLAY Independent WINDOW
LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION
Action-Maximize COLOR IS 65793
CONTROL FONT default-font ERASE LABEL-OFFSET 0
MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE "titre" TITLE-BAR NO WRAP
HANDLE IS view-WINDOW-HANDLE.
* DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE view-WINDOW-HANDLE LINES IN rz-LINES SIZE IN rz-SIZE.
MODIFY CR-VIEWER SIZE = rz-SIZE LINES = rz-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.

When the program arrived at the last modify i have a error from windows and the program stop

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
77 cr-viewer handle of CRViewer9.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
77 cr-viewer handle of CRViewer9.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
I am trying to integrate Crystal Reports with my AcuCobol app. I was fairly succesful with the OCX active-x control but was told by both Crystal and AcuCorp the preferred method was the RDC com component method. I am having difficulty with the syntax of the command to assign the odbc data source. With the OCX method the following worked:
Modify Crystal-1 Connect = DSN
(where DSN contained "DSN=field name of data set name)

I have tried the following but get compile errors:

Modify Handle-of-App @OdbcDataSourceName (DSN)

Any Ideas?

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
Any Ideas?


See my reply in the other thread.

[Migrated content. Thread originally posted on 03 February 2004]

I'm having a problem with the Crystal Reports RDC where, at times, my program will stop responding after previewing a report. It doesn't happen every time. I've tried it with Crystal Reports RDC versions 8.5, 9.0, and 10.0 and they all produce the same results. The program stops responding when I try to destroy the handle of the report object after previewing.

Has anyone else encountered this problem and found a solution?

It works fine if I print rather than preview.

Any help is appreciated.
Thanks,

I've walked it through the debugger and after previewing the report when the DESTROY CRYSTAL-RPT command is executed, the program stops resonding.

Snippets of code follow....

77 CRYSTAL-APP HANDLE OF APPLICATION.
77 CRYSTAL-RPT HANDLE OF REPORT.

MAINLINE.
CREATE @Application OF @CRAXDRT HANDLE IN CRYSTAL-APP.
MOVE CR-PASS-RPT TO WS-FILE-NAME.
INSPECT WS-FILE-NAME REPLACING TRAILING SPACES BY NULLS.
MODIFY CRYSTAL-APP @OpenReport(WS-FILE-NAME) GIVING CRYSTAL-RPT.
MODIFY CRYSTAL-RPT @DiscardSavedData().
MODIFY CRYSTAL-RPT @ReadRecords().
IF CR-PRINT
PERFORM CRYSTAL-PRINT
ELSE
PERFORM CRYSTAL-PREVIEW
END-IF.
DESTROY CRYSTAL-RPT.
DESTROY CRYSTAL-APP.
MAINLINE-EXIT.
EXIT.
/
CRYSTAL-PRINT.
MODIFY CRYSTAL-RPT @PrinterSetup(0).
MODIFY CRYSTAL-RPT @PrintOut(1).
CRYSTAL-PRINT-EXIT.
EXIT.
/
CRYSTAL-PREVIEW.
COPY RESOURCE "CRV10.res".
CALL "C$RESOURCE" USING CRESOURCE-LOAD "CRV10.res" GIVING ActiveX-Res.
DISPLAY Independent WINDOW LINES 36.50 SIZE 53.50 CELL HEIGHT 10
AUTO-MINIMIZE CELL WIDTH 10 ACTION Action-Maximize COLOR IS 65793
CONTROL FONT Small-Font ERASE LABEL-OFFSET 0 MODELESS RESIZABLE NO SCROLL
WITH SYSTEM MENU TITLE PREVIEW-TITLE TITLE-BAR NO WRAP
HANDLE IS VIEWER-WINDOW.
DISPLAY CRV-SCREEN.
CALL "C$RESOURCE" USING CRESOURCE-DESTROY ActiveX-Res.
INQUIRE VIEWER-WINDOW LINES IN WS-LINES SIZE IN WS-SIZE.
MODIFY CR-VIEWER SIZE = WS-SIZE LINES = WS-LINES.
MODIFY CR-VIEWER @ReportSource = CRYSTAL-RPT.
MODIFY CR-VIEWER @ViewReport().
MOVE SPACES TO ACTION-CODE.
PERFORM SET-ARROW-POINTER.
PERFORM ACCEPT-CRV-SCREEN UNTIL ACTION-QUIT.
DESTROY VIEWER-WINDOW.
CRYSTAL-PREVIEW-EXIT.
EXIT.
/
Any Ideas?


See my reply in the other thread.