Cobol Tools Index Data Viewer Index Introduction Features and Trial Buy DataViewer DataViewer Manual Data Conversion Service Contact Us | Data2Cr: Cobol Files in Crystal Reports |
Data2Cr enables popular report generator Crystal Reports by Seagate Software to read Cobol data files directly. Just imagine -- you can use the immense power of Crystal Reports to visually create reports that fully use fonts, graphics and other modern word processing goodies, and these reports will be filled with data read directly from your Cobol data files. You will never have to go through the hassles of the Report Section (or worse yet, plain Cobol) report generation again!
Features
User Manual: IntroductionCrystal Reports reads data files and databases using data sources. Data Source is a DLL that is located in <WindowsDir>\Crystal folder. When it is time to read a data file or a database into report, Crystal Reports calls one of these DLLs to actually read the file. Install Data2Cr. When you install DataViewer, it adds P2BCOBOOL.DLL to <WindowsDir>\Crystal folder. If installation was successful, installer will inform you about changes made to the Crystal folder. When you start the Crystal Reports application after Data2Cr installation, it will load all data source DLLs including the new Cobol Data File Reader DLL that you installed. FDD file descriptors. Since Cobol data files do not have record layout information embedded in them, your report should open not the data file itself but the *.FDD file that contains record layout and link to the actual data file. How To Create FDD file for your Data File. Use Data-Viewer to create an FDD file that describes your data file. FDD file is simply a saved layout file. How To Open Cobol Data File in Crystal Reports. When designing new report in Crystal Report Designer you start "Standard Report Expert" by selecting "File. New". Click on "Data File" (or "Database" in newer CR versions). "Choose Database File" dialogue will appear. In it change "Files of type" to "All Files". Select and open a file with *.FDD extension that represents the data file that you want to read. Do NOT select the Cobol DATA FILE itself -- it will NOT work. The FDD file will be added to the list of files. Click "Done" and dialog will close. Click the "Fields" tab and you will see a list of fields available in your file. Select the fields you want to include into your report and click "Add". Or click "Add All" to include all fierlds. Then click "Preview Report" and you will see the actual data from your Cobol data file in a Crystal Reports report.
This is what happens when Crystal reads the FDD file:
Now download DataViewer (a package that includes Data2Cr) and see for yourself how a Cobol data file is opened in CR.
Download and Run Data2Cr EvaluationData2Cr trial version is available for download now as a part of Data-Viewer. Please proceed to Cobol Data File Readers Evaluation Page. You will return here after the download. In this example we create a report from Micro Focus (MF) data file. All sample files are located in folder "Program Files\ Siber Systems\ DataViewer\ Sample Data Files". MF Cobol program file-mf.cob that includes copybook file-mf.cpy generates MF data file file-mf.dat. You can compile and run the program yourself or use the enclosed data file file-mf.dat.
Start with generating FDD file:
Now run the Crystal Reports itself.
Licensing Data2CrIf you plan to use Data2Cr internally on Four (4) computers or less, then you need Data2Cr Non-Redistributable License that is included into Data-Viewer package. If you want to distribute application that generates reports from Cobol data files using Data2Cr and Crystal Reports then you need Data2Cr Redistributable license. Please contact us for details.
User Manual: AdvancedDLL conflicts. Standard P2BBDE.DLL that comes with CR recognizes any file that is longer than 31 bytes as its own. It recognizes FDD files too (if they are longer than 31 bytes) and therefore it prevents our P2BCOBOL.DLL from recognizing FDD file. When P2BBDE.DLL takes over, you would see only "FIELD1" in the list of fields and nothing else. In Crystal Reports ver 6 and later there is a bug in P2BBTRV.DLL. It sometimes results in error message "Could not open pdbbtrv.dll. Please check its configuration" when you try to open FDD file. Whether the bug appears or not depends on physical order of DLLs in directory. Our preferred method of fixing it (it is implemented by Data2Cr installer) is: Remove P2BBDE.DLL and P2BBTRV.DLL from $systemroot\Crystal. Save it in some other directory, say, $systemroot\CrystalDisabled, so that when you need its functionality, you can move it back to $systemroot\Crystal. Shortcomings: Paradox, Btrieve and other databases that are read by P2BBDE.DLL and P2BBTRV.DLL will not be loadable to CR. Advantages: simple and makes Cobol stuff work. Crystal Reports 4.5 has no P2BBDE.DLL, so there is no need to remove it. Y2K issues. In Crystal Reports, all dates are represented in the YYYY format. But Cobol data files may contain year in the YY format. To fix this problem, DataAccess library automatically converts 2-digits-year dates to 4-digits-year dates. The conversion rule is the following: if year is less than 40, then convert it to 20YY, otherwise, convert it to 19YY. Linking Files in Data2Cr. You can link to and from Cobol data files as long as these rules are followed: |