Solved

VB coding for Crystal report version 6  and above.

Posted on 2001-08-08
6
167 Views
Last Modified: 2010-05-02
Hi,
How can I code in VB to let the user know how many pages for that particular report? And also allow user to select from start page to end page for user to preview or print?
Help appreciated.

Thanks.
0
Comment
Question by:coolkgy
[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
6 Comments
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6366768
Are you using Report OCX in VB to access CR6. If so, the report itself will have all these options, when you do,

CrystalReport1.Action = 1

You could be able to preview, and also print clicking the print button either all pages or selected pages.

You dont need to code these things.

If you need details, let me know.
0
 
LVL 1

Expert Comment

by:frankylew
ID: 6366948
perhaps he/she want to know the details even before the report is loaded.
0
 

Expert Comment

by:ibrahim-darahem
ID: 6367594
I suggest to make a test report with the margines you specified, and then find the max. no. of records per page.
fix this no. in your application, then evry time you output a report, you have to get the no. of records in the recordset that will be supplied to the crystal report, use the max. recs/page and the no. of records in the recordset to find the no. of page for the report.

if you try this solution you have to include all filters you needed in the recordset you will supply to crystal report, and not use any filters with the crystal report itself.

i hope it helps.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6367604
frankylew,
I was waiting to get response from coolkgy regarding that.

coolkgy,
Ok, if that is the case, you do the following. Hope you already have created the report using Crystal report and say, the report name is report1.rpt and is located in your VB application path. To open it from VB do this.:


1) Click Project/Components menu option.
   Select Crystal Report Control.

2) Put the Crystal Report Control to a form, from the toolbox.

3) Add a Command Button to form.

4) Put the code to Command1's Click Event as below:
'*******

Private Sub Command1_Click()
    CrystalReport1.ReportFileName = App.Path & "\report1.rpt"
    CrystalReport1.ReportTitle = "The Title you want"
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.Action = 1
End Sub

'*******


Hope This Helps.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7199851
Hi coolkgy,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.
    *** we don't know if Crystal Reports is the issue, so can't really say anyone is correct.

coolkgy, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7213417
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

691 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