Forum Discussion
- Ryan_MoranValued ContributorWhat are you trying to accomplish exactly?
- Ryan_MoranValued ContributorI see that you are looking at a crystal reports report. While it's entirely possible to find the text buried in the object properties it would probably be best if you performed an image comparison to check the report.
More information here.
And here. - karkadilValued Contributor
- Ryan_MoranValued ContributorIf you have a URL to the report I could check the property myself and probably find the property you want, but in the .Net version of crystal reports it looks something like this to get the text:
myPageObject = Sys.Process("CNRpt").WinFormsObject("CNRptView").WinFormsObject("crViewer").WinFormsObject("PageView", "", 1).WinFormsObject("TabControl", "").WinFormsObject("DocumentControl", "Main Report").WinFormsObject("PageControl", "");
myText = myPageObject.SectionInstances.Item(0).ReportObjectInstances.Item(0).TextLines.Item(0);
Of course that is just the text of one line in the report and each sectioninstance, reportobjectinstance, and textline needs to be iterated to obtain all the text of the report. I used this method for a long time, but eventually found it more practical to perform image compares. Sorry I don't have a better solution for you. - Ryan_MoranValued ContributorDoes not look like it's supported with that version of crystal reports.
Edit: Also check to make sure you are selecting the page within the window not the entire window. That is possibly the issue?
I still think image compares would work best and just create a routine to navigate each report page.
The other option is OCR as previously suggested. - Ryan_MoranValued ContributorWithout some sort of page or index property to work with I'd say you probably need to use the .Keys() method to page through the report.
- amithsidContributor
window object-Sys.Process("RptsLib").Window("#32770", "", 1).Window("ATL:60088388", "", 1).Window("CrystalReports10.ActiveXReportViewer.1.ReportAlbum", "", 1).Window("CrystalReports10.ActiveXReportViewer.1.ViewHolder", "", 1).Window("ATL:60088C98", "", 1);
I want to perform a check on the text inside this page of a window. It is not providing the text in any of its properties. Text recognition is also not working. - amithsidContributorHi Ryan, thanks for ur reply. I wanted to use text recognition particularly. Comparing images will be a tedious job because it might have multiple pages. I need to build a single reusable module which will take the string given and will compare with the string inside the object. Is there a method to do so?
- amithsidContributor
- amithsidContributorHI, I have spied the inner window itself, not the outside window. I am planning to use OCR on the image that I capture at runtime. Do you have any idea about how to iterate through the pages?
Related Content
- 3 years ago
Recent Discussions
- 4 days ago
- 4 days ago