print a crystal report filtered to a data row that is on a form (2 Viewers)

bigmac

Registered User.
Local time
Today, 16:17
Joined
Oct 5, 2008
Messages
295
hello can you help please , i have a form (frm1) with a button to open a crystal report to show all the data in a database what i am trying to do is get the report only to show the row of data on the (frm1), i have the button working and it opens the report but it is showing all data rows, visual studio 2019
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:17
Joined
Oct 29, 2018
Messages
21,358
Hi. Sorry if this doesn't help. I don't have experience with Crystal Reports, but in Access, you can open a report using the OpenReport method, which has a WhereCondition argument. How do you open a Crystal Report using your button? Is there a way to include a WhereCondition (a Filter criteria) to it?
 

bigmac

Registered User.
Local time
Today, 16:17
Joined
Oct 5, 2008
Messages
295
hi theDBguy, thank you for your quick response , the report is on a form and is quite easy to open it just " open form2.show" you can put code on the onload, but i do not know how to go about this, if this was access it would be quite easy to to a open where clause , but i don't know if this would work on visual studio
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:17
Joined
Oct 29, 2018
Messages
21,358
hi theDBguy, thank you for your quick response , the report is on a form and is quite easy to open it just " open form2.show" you can put code on the onload, but i do not know how to go about this, if this was access it would be quite easy to to a open where clause , but i don't know if this would work on visual studio
Oh, okay. Sorry, I don't have any idea either. Let's hope someone else jumps in who knows. Good luck!
 

kevlray

Registered User.
Local time
Today, 16:17
Joined
Apr 5, 2010
Messages
1,046
There are lots of ways to 'show' a Crystal Report. You may be able to use a viewer, but I do not know if they accept parameters. Another way is to use the SDK tools provided by SAP (beyond what I know about).
 

vhung

Member
Local time
Today, 16:17
Joined
Jul 8, 2020
Messages
235
hello can you help please , i have a form (frm1) with a button to open a crystal report to show all the data in a database what i am trying to do is get the report only to show the row of data on the (frm1), i have the button working and it opens the report but it is showing all data rows, visual studio 2019
good day
>: crystal report is outside msaccess, but data on actbl/ link
check your crystal reports design then set the parameters as you set on your form
<: i never tried using codes on crystal,
but rather set the parameter as you need to show on reports
 
Last edited:

Isaac

Lifelong Learner
Local time
Today, 16:17
Joined
Mar 14, 2017
Messages
8,738
Add a parameter to the crystal report that effectively reduces the output of the report according to your desired specifications.
Use a tool like this to create a CMD or BAT file that you can then run using VBA.

Just an idea?

I had an exe that I could manipulate using command line programming years ago that would fire up a crystal report, input a parameter, and print to pdf. can't find which one it is now though, memory does not serve.
 

Users who are viewing this thread

Top Bottom