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
Solved

How to Control Crystal Report with Visual Basic

Posted on 2003-10-24
4
317 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
  • 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

808 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