Print Page | Close Window

filter report to show record on form

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22892
Printed Date: 28 Apr 2024 at 7:33am


Topic: filter report to show record on form
Posted By: bigmacagain
Subject: filter report to show record on form
Date Posted: 05 Sep 2020 at 8:13am
hello can you help a newbie please, i am using visual studio 2019 , i have a form(frm1) and this has shows 1 record from my database, i want the user to click a button and show a report filtered to the record shown on frm1, i have a button that opens the report but shows all records, how can i filter it in VB to on load just show the record on the form please?   



Replies:
Posted By: lockwelle
Date Posted: 21 Sep 2020 at 11:48am
Depends on how the report is getting data. If it is calling a stored proc, you would need to pass the record displayed on your form to the proc and have it filter the data. If you are pushing the dataset to the report, you could use linq or a loop to filter the dataset to only have the data for the record that is displayed.

For pushing the data, you can have the app call the stored proc, then filter out the records that are not needed and finally set the reports.DataSource to the filtered dataset (or it can be a datatable).

HTH



Print Page | Close Window