Joined: 28 Aug 2020
Location: United Kingdom
Online Status: Offline
Posts: 1
Topic: filter report to show record on form 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?
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
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).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum