Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: filter report to show record on form Post Reply Post New Topic
Author Message
bigmacagain
Newbie
Newbie


Joined: 28 Aug 2020
Location: United Kingdom
Online Status: Offline
Posts: 1
Quote bigmacagain Replybullet 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?   
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.035 seconds.