Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 326
  • Last Modified:

How to Control Crystal Report with Visual Basic

I already make this report(sample.rpt) with crystal report 8.5

Num|Item             |  qty|     Price |    Total|
--------------------------------------------------------
1     |Car               |   10|   10000|1000000|

For Some user I need to hide Price And Total.
How I Can do that , whith Visual basic 6.0 ?


CrystalReport1.WindowState = crptMaximized
CrystalReport1.RetrieveDataFiles
CrystalReport1.Action = 1
0
ekohartono
Asked:
ekohartono
  • 2
1 Solution
 
EYoungCommented:
A couple of suggesions, both of which will work:

1.  In CR you can right click on the field(s), select Format Field, click on the Common tab, check the Suppress box, click the code box to the right of the Suppress box and enter the user names.

-OR-

2.  In VB you can just write the reporting records out to a temporary file and point CR to that file for its source input file.  Then in VB you can check to see if the user should see or not see the fields.  If not see, then don't write out the fields to the temporary file.

Best of luck
0
 
pg_indiaCommented:
u mean to say that you want that for some users a field should come and for others it should not come.

Well what u can do is to create a parameter field in Crystal report and then pass the username to it.

Now write a formula like
if username(this is parameter field) = username then
    'u returen blank
else
    'u return something
end if

I remember in expert exchange someone has put the code to access cr field from VB but now i don't remeber the question number..do some search and you willl find it..



0
 
planoczCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from ekohartono from 10/25/2003 comment
Award points to EYoung(50%) and pg_india(50%) is recommend.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
0
 
EYoungCommented:
Thanks for cleaning this up.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now