Solved

How to Control Crystal Report with Visual Basic

Posted on 2003-10-24
4
319 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

739 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