Highlighted
Absent Member.
Absent Member.
2549 views

[archive] Help Needed With using Crystal Reports

[Migrated content. Thread originally posted on 15 December 2006]

Hello,

We use Cystal Reports XI for creating reports for our AcuCOBOL Application ( Acuthin as client on Windows PC and Linux as Server).
We would like to create Crystal Reports (.rpt files) and be able to distribute to clients with same database(different schema and but same database layout). We would develop reports for our Oracle database and deploy them at Client's location.Is there a way to pass the database connection parameters at runtime to the cystal reports so that they don't need to have a crystal reports developer edition at their end to re-establish their database connection.

We are planning to use a third party report viewer( recrystallize's cview ) for the clients to view and print the reports.

Acucorp Customer support says that we can use AcuODBC for integrating crystal reports into the AcuCOBOL environment. But with little or no information on how to use it we pursued a different path for running crystal reports. We would be glad with any help in running crystal reports anyway possible.

Any Help Appreciated,
Thank You
Vinay
0 Likes
9 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

I believe you will have to ask Crystal Reports if you can set the database connection dynamically at runtime. Sounds like a natural thing to do though, so I would be surprised if it was not possible.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

I have contacted crystal reports regarding the issue and they seem to suggest that it is not possible to set database connection dynamically if I don't use either VB or .NET. It seems only possible using those two application. I am not sure if there are any alternatives anybody know in this forum.


Thank You
Vinay
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

I am not able to find any good solution for our crystal report issues. How can I call crystal report (.rpt files) from COBOL program for any data source.

Thank You
Vinay
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

Ask them for a code example on how to set the database connection dynamically in VB and then translate that into ACUCOBOL-GT.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

I found a sample code using visual basic. How do I translate that to AcuCOBOL.

Thank You
Vinay
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

That is the trick. From your initial post, I got the understanding that you already have implemented use of Crystal Reports, hence, you must have done some programming. Then you just translate that part that does the actual dynamic opening. You can try post that part here, someone may be able to help you do it, or you may try yourself. Or, you can also contact Acucorp SE.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

The thing is that I would like to be able call crystal reports from AcuCOBOL program.


Let me know if anyone has a sample program and what is needed to run the program,


Vinay
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports

FYI

I use oracle 10g as the data source for the database connection
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Help Needed With using Crystal Reports


       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  TEMPLATE.
       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY "X_CRVIEW9.cpy".
           COPY "X_CRDDRT9.cpy".
             .
       WORKING-STORAGE SECTION.
        77 oApp                     usage handle of Application.
    77 oReport            usage handle of Report.
    77 oTableLinks            usage handle of TableLinks.
    77 oTableLink            usage handle of TableLink.
        77 oSourceDBTable        usage handle of DatabaseTable.
        77 oDestinationDBTable        usage handle of DatabaseTable.
    77 oSourceDBField        usage handle of
                    DatabaseFieldDefinition.
    77 oDestinationDBField        usage handle of
                    DatabaseFieldDefinition.
    77 oDatabase            usage handle of Database.
       77  CNTL-FONT                USAGE HANDLE OF FONT SMALL-FONT.
       77  KEY-STATUS               IS SPECIAL-NAMES
           CRT STATUS               PIC 9(4) VALUE 0.
           88  EXIT-PRESSED         VALUE 27.

       SCREEN      SECTION.
       01  TEMPLATE-SCREEN.

           03      PUSH-BUTTON
                   LINE             13
                   COL              63
                   SIZE             14
                   TITLE            "E&xit"
                   SELF-ACT
                   EXCEPTION-VALUE  = 27.

       PROCEDURE DIVISION.
       MAIN-LOGIC.

           DISPLAY STANDARD         GRAPHICAL WINDOW
                   TITLE            "Template"
                   CONTROL          FONT CNTL-FONT
                   SIZE             80
                   LINES            15
                   BACKGROUND-LOW.

       PERFORM INITIALIZE-DATA.
           DISPLAY TEMPLATE-SCREEN.
           PERFORM WITH TEST AFTER  UNTIL EXIT-PRESSED
                   ACCEPT           TEMPLATE-SCREEN
           END-PERFORM.
           DESTROY TEMPLATE-SCREEN.
           STOP    RUN.

       INITIALIZE-DATA.

           INITIALIZE               KEY-STATUS.
           CREATE  Application      HANDLE IN oApp.
           MODIFY  oApp
                   @SETLICENSEKEYCODE("your license goes here").
           MODIFY  oApp             NewReport()
                   GIVING           oReport.
           INQUIRE oReport          Database
                   IN               oDatabase.
           MODIFY  oDatabase        Tables::Add(
                   "c:\data\somedb.mdb", "TableA").
           MODIFY  oDatabase        Tables::Add(
                   "c:\data\somedb.mdb", "TableB").
           INQUIRE oDatabase        Links
                   IN               oTableLinks.
           INQUIRE oDatabase        Tables::Item(1)
                   IN               oSourceDBTable.
           INQUIRE oDatabase        Tables::Item(2)
                   IN               oDestinationDBTable.
           INQUIRE oSourceDBTable   Fields::Item(1)
                   IN               oSourceDBField.
           INQUIRE oDestinationDBTable
                   Fields::Item(3)
                   IN               oDestinationDBField.
           MODIFY  oTableLinks      @Add(oSourceDBTable,
                   oDestinationDBTable,
                   oSourceDBField,
                   oDestinationDBField,
                   crJTEqual,
                   crLTLookupParallel,
                   0,
                   1)
                   GIVING           oTableLink.
      * View the report...
           EXIT    PARAGRAPH.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.