Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to Control Crystal Report with Visual Basic

Posted on 2003-10-24
4
Medium Priority
?
322 Views
Last Modified: 2013-11-25
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
Comment
Question by:ekohartono
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Expert Comment

by:EYoung
ID: 9617917
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
 
LVL 3

Accepted Solution

by:
pg_india earned 1500 total points
ID: 9618873
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
 
LVL 27

Expert Comment

by:planocz
ID: 10183563
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
 
LVL 7

Expert Comment

by:EYoung
ID: 10185911
Thanks for cleaning this up.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question