Do not use on any
shared computer
August 29, 2008 07:05pm pdt
 
[x]
Attachment Details

Export .rpt reports to pdf, txt, excel etc using vb 6

Tags: crystal, export, report, pdf
Hi, i would like to export .rpt files to pdf, txt, excel etc using vb 6. In VB 6 i have use the crystal report viewer 9 to open the crystal report. By rite the viewer should already have the ability to export files to other formats but dun noe y, my viewer in vb 6 dun have the export icon. Can somebody tell mi how can i get the icon or give mi the codes to help export the rpt files to other format. Tks alot... Pls reply ASAP. Tks
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Database
Question Asked By: lindalim
Solution Provided By: mlmcc
Participating Experts: 10
Solution Grade: B
Views: 616
Translate:
Loading Advertisement...
 
[+][-]Accepted Solution by mlmcc

Rank: Genius

Accepted Solution by mlmcc:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by lindalim
Author Comment by lindalim:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by incasan
Expert Comment by incasan:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by lindalim
Author Comment by lindalim:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by incasan
Expert Comment by incasan:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Jeff-Net
Expert Comment by Jeff-Net:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by mlmcc

Rank: Genius

Expert Comment by mlmcc:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by rajendra_adari
Expert Comment by rajendra_adari:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by mlmcc

Rank: Genius

Expert Comment by mlmcc:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by mca7101
Expert Comment by mca7101:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by mlmcc

Rank: Genius

Expert Comment by mlmcc:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by rajeshbshenoy
Expert Comment by rajeshbshenoy:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by mlmcc

Rank: Genius

Expert Comment by mlmcc:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by davidvanrensburg
Expert Comment by davidvanrensburg:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by SahirProjects
Expert Comment by SahirProjects:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by mlmcc

Rank: Genius

Expert Comment by mlmcc:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by RickySantos
Expert Comment by RickySantos:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by mlmcc

Rank: Genius

Expert Comment by mlmcc:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Open Discussion
Open Discussion
 
Comment by Lopsy
RickySantos:
i hope this helps
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
Private Function RptSpooler(reportname As String, p_cod_bank As String, p_cod_branch As String, p_dat_proc As String, p_nam_bank As String, _
p_nam_branch As String, p_user_id As String, p_session_id As String, strDestPath As String) As Boolean
    Dim CrApp As CRAXDRT.Application
    Dim CrRep As CRAXDRT.Report
    Dim myDatabase As CRAXDRT.Database
    Dim myDbTables As CRAXDRT.DatabaseTables
    Dim myDbTable As CRAXDRT.DatabaseTable
    Dim mySections As CRAXDRT.Sections
    Dim mySection As CRAXDRT.Section
    Dim mySubreport As CRAXDRT.Report
    Dim mySubreportObject As CRAXDRT.SubreportObject
    Dim myParameterfields As CRAXDRT.ParameterFieldDefinitions
    Dim myparamfield As CRAXDRT.ParameterFieldDefinition
    Dim crEFTTXT As CRAXDRT.CRExportFormatType
    Dim i As Integer
    Dim j As Integer
    Dim x As Integer
       
        
  '''''''''  On Error GoTo cError
    Set CrApp = New CRAXDRT.Application
    Set CrRep = CrApp.OpenReport(reportname)  ' ("C:\flexcube\host\rptdefn\GL008.rpt")
    Set myDatabase = CrRep.Database
    Set myDbTables = myDatabase.Tables
    
    'Set myDbTable = myDatabase.Table
    
    CrRep.DiscardSavedData
    
'                    CrRep.ParameterFields.GetItemByName("p_cod_bank").AddCurrentValue "44"
'                    CrRep.ParameterFields.GetItemByName("p_cod_branch").AddCurrentValue p_cod_branch
'                    CrRep.ParameterFields.GetItemByName("p_dat_proc").AddCurrentValue "01/05/2008"
'                    CrRep.ParameterFields.GetItemByName("p_nam_bank").AddCurrentValue p_nam_bank
'                    CrRep.ParameterFields.GetItemByName("p_nam_branch").AddCurrentValue p_nam_branch
'                    CrRep.ParameterFields.GetItemByName("p_user_id").AddCurrentValue p_user_id
'                    CrRep.ParameterFields.GetItemByName("p_session_id").AddCurrentValue p_session_id
    'CRViewer91.ReportSource =
    i = 1
    For i = 1 To myDbTables.Count
        myDbTables(i).SetLogOnInfo DSN, DSN, uname, pwd
    Next i
    
    Set mySections = CrRep.Sections
    For Each mySection In mySections
        For x = 1 To mySection.ReportObjects.Count
            If mySection.ReportObjects(x).Kind = crSubreportObject Then
                Set mySubreportObject = mySection.ReportObjects(x)
                Set mySubreport = mySubreportObject.OpenSubreport
                Set myDatabase = mySubreport.Database
                Set myDbTables = myDatabase.Tables
                j = 1
                For j = 1 To myDbTables.Count
                    myDbTables(j).SetLogOnInfo DSN, DSN, uname, pwd
                Next j
            End If
        Next x
    Next mySection
    
    Set myParameterfields = CrRep.ParameterFields
    For Each myparamfield In myParameterfields
        With myparamfield
            Select Case .ParameterFieldName
                Case "p_cod_bank"
                    .SetCurrentValue p_cod_bank
                Case "p_cod_branch"
                    .SetCurrentValue p_cod_branch
                Case "p_dat_proc"
                    .SetCurrentValue p_dat_proc
                Case "p_nam_bank"
                    .SetCurrentValue p_nam_bank
                Case "p_nam_branch"
                    .SetCurrentValue p_nam_branch
                Case "p_user_id"
                    .SetCurrentValue p_user_id
                Case "p_session_id"
                    .SetCurrentValue p_session_id
            End Select
        End With
    Next
    
    CrRep.EnableParameterPrompting = False
    
    CrRep.ExportOptions.FormatType = crEFTText  'crEFTPortableDocFormat
    CrRep.ExportOptions.DestinationType = crEDTDiskFile
    CrRep.ExportOptions.DiskFileName = strDestPath
    CrRep.Export (False)
    
   ' mySection = Nothing
    'mySubreport = Nothing
    'mySubreportObject = Nothing
    
    Set CrApp = Nothing
    Set CrRep = Nothing
 
   ' myDbTables = Nothing
 
    'mySections = Nothing
 
    'myParameterfields = Nothing
    'myparamfield A = Nothing
    'myDbTable = Nothing
    'myDatabase = Nothing
    RptSpooler = True
'cError:
'    If Err.Number <> 0 Then
'        MsgBox Err.Description, vbCritical
'        Exit Function
'    Else
'        Me.Caption = Me.Caption + " ..Getting Report data"
'    End If
End Function
Open in New Window
 
 
20080723-EE-VQP-34