Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB coding for Crystal report version 6  and above.

Posted on 2001-08-08
6
Medium Priority
?
172 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
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
Industry Leaders: 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!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 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…
Suggested Courses

782 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