Forum Discussion

paulsonvm's avatar
paulsonvm
Occasional Contributor
13 years ago

Unable to compare data displayed in Crystal Report.

Hi,



I am new to Test Complete. Our application displays data in Crystal Report. I am trying to read data from Crystal Reports and check if it displays the correct data. I tried Region check point and found Region checkpoints are not always verifying the data correctly. Application can export Data displayed in Crystal report to other formats such as .doc, .xls, .pdf, .csv etc. If there any way I can check the data in the report after exporting the file to any of the above mentioned formats.



Any help appreciated.



Thanks,



Paulson 

5 Replies

  • karkadil's avatar
    karkadil
    Valued Contributor
    Crystal Reports is a .NET third-party control and it is obfuscated, that's why you can't work with it. Basically, the names of the controls always different after compilation and you get errors like "Object not found".



    Unfortunately, AFAIK there is no "clear" way to get the report's content. You have to copy the content of the report to the Clipboard (there is a toolbar button in the report window to do this). When I worked with Crystal Reports, it was the easiest way I could find.
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Paulson,


    Have you tried using File checkpoints?


    These checkpoints let you compare the contents of two files of the same format. So, you need to create one file of each format (.doc, .csv, and so on) and populate the files with the expected data (they will be treated as the baseline copies during the file comparison). Then, TestComplete will compare new files (generated by Crystal Reports) with the stored baseline copy every time you run the test and will provide you with results of the comparison.


    Does this help?

  • paulsonvm's avatar
    paulsonvm
    Occasional Contributor
    Thanks for getting back to me.



    I tried file check point. Report contains a time stamp which changes every time I run the report. I have a master file (saved in .doc format) without time stamp and each time report generated I will remove the time stamp manually save it as .doc file before doing the file comparison using file checkpoint. But I have noticed check point is failing the file size is different (even though the file content is correct). I also tried to give some allowed bytes to the check point. But every time file is compared file size difference not the same. When file size difference is above the allowed byte size then my test fails. Any idea to correct this.



    Thanks,



    Paulson
  • paulsonvm's avatar
    paulsonvm
    Occasional Contributor
    Hi,



    Just to add I am only worried about the contents of the file not the size or locations in the file.



    Thanks,



    Paulson