Solved

VB coding for Crystal report version 6  and above.

Posted on 2001-08-08
6
162 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
Comment Utility
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
Comment Utility
perhaps he/she want to know the details even before the report is loaded.
0
 

Expert Comment

by:ibrahim-darahem
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
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
Comment Utility
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
Comment Utility
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

743 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

16 Experts available now in Live!

Get 1:1 Help Now