Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,320 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,715 people online right now. Registration is fast and FREE... Join Now!




Crystal Report

 
Reply to this topicStart new topic

Crystal Report

masipro
27 Aug, 2008 - 01:54 AM
Post #1

New D.I.C Head
*

Joined: 8 Jul, 2008
Posts: 39

Hai,
Using VB6 i code to add and display Crystal report. The printing option works only we click the icon in menu bar. when I used to Press 'Ctrl+P', it won't work in the form as how it works usually in Cryastal Report Application.
Please let me have function of 'Ctrl+P' in VB itself. My coding is as follows

CODE


Private Sub cmdprint_Click()

If IsNull(dtcCustomer.Text) Then MsgBox "Select Customer ": dtcCustomer.SetFocus: Exit Sub
If Combo1.Text = "Clicking" Then
     If Not dtcCustomer.Text = "Bostonian" Then
    Selected_Report_Path = "E:\log\CheckList-Upper.rpt"
    Else
    Selected_Report_Path = "E:\log\CheckList -Upper(Bost).rpt"
    End If
    
    If Selected_Report_Path <> Empty Then
    Dim crystal As CRAXDRT.Application
    Dim report As New CRAXDRT.report
    
    Set crystal = New CRAXDRT.Application
    Set report = crystal.OpenReport(Selected_Report_Path)
    report.ParameterFields(1).AddDefaultValue dtcCustomer.Text
    report.ParameterFields(2).AddDefaultValue txtOrderNo.Text
    report.ParameterFields(3).AddDefaultValue dtcPlanNo.Text
    report.ParameterFields(4).AddDefaultValue "Upper Leather 1"
    report.DiscardSavedData

    CRViewer91.ReportSource = report
    CRViewer91.ViewReport
    CRViewer91.EnableCloseButton = True
    CRViewer91.EnablePrintButton = True
    
    
    End If
Else

End If

sorry i wrote in 'Computer support & operating system' Group . it is to be in Visual Basic group

This post has been edited by jayman9: 27 Aug, 2008 - 09:45 AM
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Crystal Report
27 Aug, 2008 - 09:46 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,926



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Moved to Visual Basic.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 07:21AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month