cancel
Showing results for 
Search instead for 
Did you mean: 

Getting data into CR viewer from windows forms

Former Member
0 Kudos

Environment: Windows form, CR Viewer, CR 2008, VS 2008 and C#

.NET 3.5

How we get data from the Winforms to CR reports?

For example, the winform has report selection criteria (form and to date etc) and when user select a report, a stored procedure is called, data is populated into a work file. CR displays the work file.

In this case, user wants to see the selection criteria on the reports.

Yes, we can add fields in the work file and get it. But, is there any way to show this info direct from the winform?

Thank You

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can add parameters to the CR and then populate those in the code of the Winform. Then in the CR, print the contents of the parameters whereever you want.

Answers (1)

Answers (1)

former_member292966
Active Contributor
0 Kudos

Hi Benny,

After the criterias are set, you can retrieve the Selection Formula to be displayed on your winform. Getting the RecordSelectionFormula property of the report will allow you to drop it onto your report.

Good luck,

Brian

Former Member
0 Kudos

Thanks, Brian. But, the selection criteria is different. This is a date field on the winform. That is what I want to display on the report.

former_member292966
Active Contributor
0 Kudos

Hi Benny,

Sorry I misunderstood where you wanted the criteria to appear. Create an empty formula and drop it on the report where you want your criteria to appear.

From your application, you can create a string that you can pass to that formula using the FormulaFields property of the Report object.

Good luck,

Brian

Former Member
0 Kudos

Brian, Thanks again. But, I have a formula to select records already. Hence, I can't add this to the formula.