RE:API Creacion de Informes
Mi problema es que quiero utilizar Embeddable Crystal Reports Designer Control library 11 y utilizado el ejemplo que viene en los manuales para vb. Yo lo ejecuto en mi maquina que tiene vb6 y cr11 developer y puedo crear, abrir y modificar informes sin embargo lo compilo me lo llevo a otra maquina que no tiene el vb ni cr11 y no puedo ni abri ect..
Este es el codigo:
Option Explicit
Dim m_Application As New CRAXDDRT.Application
Dim m_Report As CRAXDDRT.Report
Dim crapp As CRAXDDRT.Application
' *************************************************************
'DisplayReport is a procedure that
' - Enables the Tab control the first time a report is created
' or opened.
' - Sets the report object to the Embeddable Designer(CRDesigner1).
' - Disables the Help menu in the Embeddable Designer.
' - Sets the report object to the Crystal Report Viewer Control
' (CRViewer1).
' - Sets the Crystal Reports Viewer to view the report.
Public Sub DisplayReport()
' Enable the tab control if disabled.
If SSTab1.Enabled = False Then SSTab1.Enabled = True
' Set the Report Object.
CRDesignerCtrl1.ReportObject = m_Report
' Note----------------
' Set all other properties for CRDesignerCtrl1 after setting the
' ReportObject property
' --------------------
' Disable the Help menu.
CRDesignerCtrl1.EnableHelp = False
' Set the report source.
CrViewer1.ReportSource = m_Report
' Set the viewer to view the report.
CrViewer1.ViewReport
' Set the zoom level to fit the page
' to the width of the viewer window.
CrViewer1.Zoom 1
End Sub
' *************************************************************
Private Sub Form_Load()
' Set the tab control to display the Designer tab
'when the form is loaded.
Set crapp = New CRAXDDRT.Application
crapp.SetLicenseKeycode ("B6W60-01CS200-000G970-0YA1")
SSTab1.Tab = 0
End Sub
' *************************************************************
Private Sub SSTab1_Click(PreviousTab As Integer)
' Refresh the report when clicking Preview,
' without refreshing the data from the server.
If PreviousTab = 0 Then CrViewer1.RefreshEx False
End Sub
' *************************************************************
' Create a new report and display it in the Embeddable Designer
Private Sub cmdNew_Click()
' Set the report object to nothing.
Set m_Report = Nothing
' Create a new report.
Set m_Report = m_Application.NewReport
' Call DisplayReport to set the report to the Embeddable Designer
' and the Crystal Report Viewer and then display the report in the
' Embeddable Designer.
Call DisplayReport
End Sub
' *************************************************************
' Use the Microsoft Common Dialog control to open a report.
Private Sub cmdOpen_Click()
CommonDialog1.CancelError = True
On Error GoTo errHandler
' Display the open dialog box.
CommonDialog1.ShowOpen
' Set the report object to nothing.
Set m_Report = Nothing
' Open the selected report.
Set m_Report = m_Application.OpenReport(CommonDialog1.FileName, 1)
' Call DisplayReport to set the report to the Embeddable Designer
' and the Crystal Report Viewer
Call DisplayReport
Exit Sub
errHandler:
' User cancelled dialog
End Sub
' *************************************************************
'Private Sub cmdAbout_Click()
'frmAbout.Show vbModal
'End Sub
' *************************************************************
Private Sub cmdExit_Click()
Unload Me
End Sub
Gracias.