For Excel, I would start by using Excel via COM to access the sheet itself, especially if you're doing this kind of comparison and not a data driven test. See https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou... for beginning information on how to do that.
As for the PDF part, look into using PDFbox as described at https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete
I'll leave it up to you to determine the specific implementation you choose to do the comparison but I would start with those two links and start building your code.
I got how to fetch data from excel and PDf.But I wanted to compare the data in excel and data in PDf.Is there is a possible way to do so
Yes... write code to do so. :-)
You read the stuff from the Excel, you read it from the PDF, and you do an "if then" to compare or some such thing. There is nothing "out of the box" to compare the two. You need to write that code yourself.
I agree with tristaanogre.
Only you know how the data in both files should be matched. Thus, you'll need to script a comparison algorithm that will read data from both sources and compare them as needed. TestComplete supports a set of languages. You can use the one you prefer: