Forum Discussion

Dewayne_Pinion's avatar
Dewayne_Pinion
Contributor
10 years ago
Solved

.NET ReportViewer - how to verify reports

All,

Our application uses the .NET report viewer to display report information from our database. The viewer itself seems flat and I cannot access individual fields for comparison. Could anyone suggest how I might go about comparing the data in this case?

 

Thanks

  • You can access data in the report by using ReportViewer's native properties and methods, such as:
    LocalReport.DataSources.Item(DataSourceIndex).Value
    ServerReport.GetDataSources().Item(DataSourceIndex).Value

    You can also turn on Microsoft UI Automation identification for your application - this should expose the report elements as individual objects.

    • Go to Tools > Current Project Properties.
    • Select the Open Applications > UI Automation category.
    • Add WindowsForms*.Window*  to the list.
    • Save the changes.

4 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    You can access data in the report by using ReportViewer's native properties and methods, such as:
    LocalReport.DataSources.Item(DataSourceIndex).Value
    ServerReport.GetDataSources().Item(DataSourceIndex).Value

    You can also turn on Microsoft UI Automation identification for your application - this should expose the report elements as individual objects.

    • Go to Tools > Current Project Properties.
    • Select the Open Applications > UI Automation category.
    • Add WindowsForms*.Window*  to the list.
    • Save the changes.
    • Dewayne_Pinion's avatar
      Dewayne_Pinion
      Contributor

      I don't believe this will help us to validate the data that is in the report? How would we go about making sure the data in the report is correct?

       

      Thanks