Solved

How to Control Crystal Report with Visual Basic

Posted on 2003-10-24
4
313 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for cleaning this up.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now