Computing.Net > Forums > Programming > VB 6.0/Crystal Reports

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VB 6.0/Crystal Reports

Reply to Message Icon

Original Message
Name: Canadaba
Date: April 17, 2002 at 05:36:44 Pacific
Subject: VB 6.0/Crystal Reports
Comment:

Is it possible to pass the values of global variables from user input on a vb form into the SQL query of a Crystal Report form. I am trying to get the user to fill out the necessary information for a report and then have the report done in Crystal reports with in my VB application. Thanks.


Report Offensive Message For Removal


Response Number 1
Name: MAthieu Vachon
Date: April 18, 2002 at 11:01:54 Pacific
Reply: (edit)

Private Sub ImprimerRapport(sNomRap As String, PrintMode As Long)
Dim crxApplication As New CRAXDRT.Application
Dim m_Report As CRAXDRT.Report
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim x As Long
Dim sChemin As String
Dim iIDProbleme As Long
Dim sSQL As String
Dim itmx As ListItem

If Me.ListViewProblemes.ListItems.Count > 0 Then

iIDProbleme = Me.ListViewProblemes.SelectedItem.Tag

sChemin = App.Path & "\" + sNomRap

Set m_Report = crxApplication.OpenReport(sChemin, 1)
If m_Report.ParameterFields.Count > 0 Then
For x = 1 To m_Report.ParameterFields.Count
Select Case UCase(m_Report.ParameterFields(x).ParameterFieldName)
Case "IDPROBLEME"
Set crxParameterField = m_Report.ParameterFields.Item(x)
crxParameterField.AddCurrentValue iIDProbleme
End Select
Next x
End If
If PrintMode = 2 Then
For Each itmx In Me.ListViewProblemes.ListItems
If Len(sSQL) > 0 Then
sSQL = sSQL + ", " & itmx.Tag
Else
sSQL = itmx.Tag
End If
Next itmx

m_Report.RecordSelectionFormula = " {ado.ID_Probleme} IN [" & sSQL & "] "
Else
m_Report.RecordSelectionFormula = " {ado.ID_Probleme} = " & iIDProbleme
End If

m_Report.PrintOut
Else
MsgBox "Rien a imprimer..." + vbCr + vbCr + "Nothing to print...", vbExclamation + vbOKOnly
End If

End Sub


Report Offensive Follow Up For Removal

Response Number 2
Name: kss
Date: July 12, 2002 at 02:13:41 Pacific
Reply: (edit)

vb crystal


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software