Nitesh
Oct 16th, 2007, 01:56 AM
Hi all,
I have the following code to populate the CrystalActiveXViewer everytime I click on a listview item.
this is the command for the recordselection formula:
Call GetNoteContents("({Command.noteid} = " & SNId & ")")
Sub GetNoteContents(FilterSql)
On Error GoTo LoadReport_Error
lvwOldNotes.Enabled = False
'Set oApp = CreateObject("CrystalRuntime.Application.11")
Set oReport = New CrystalReport2
oReport.EnableParameterPrompting = False
oReport.DiscardSavedData
oReport.FormulaSyntax = 0
oReport.RecordSelectionFormula = FilterSql
'oReport.PaperOrientation = crPortrait
CrystalActiveXReportViewer1.ReportSource = oReport
'CrystalActiveXReportViewer1.Refresh
'CrystalActiveXReportViewer1.RefreshEx (True)
CrystalActiveXReportViewer1.ViewReport
Delay 1 'give report time to load otherwise it fails if user clicks on combo twice while reportviewer is loading
lvwOldNotes.Enabled = True
'Set oApp = Nothing
'Set oReport = Nothing
Exit Sub
LoadReport_Error:
errmsg "The following Exception occured : " & ERR.Description & ", " & ERR.Source & "", "Exception occured in frmItemManager.LoadReport()"
End Sub
Problem is everytime I click on the listview the data for that goods delivery note should come up. I have a command inside my designer to select the desired fields.
One of the fields display - "Goods Delivery Note" or "Goods Received Note"
When I click on the listview to bring up the contents of the selected note, sometimes the entire text "Goods Delivery note" appears correctly, other time just a "g" appears in that textbox.
What could be the problem here. Please help me.:confused:
I have the following code to populate the CrystalActiveXViewer everytime I click on a listview item.
this is the command for the recordselection formula:
Call GetNoteContents("({Command.noteid} = " & SNId & ")")
Sub GetNoteContents(FilterSql)
On Error GoTo LoadReport_Error
lvwOldNotes.Enabled = False
'Set oApp = CreateObject("CrystalRuntime.Application.11")
Set oReport = New CrystalReport2
oReport.EnableParameterPrompting = False
oReport.DiscardSavedData
oReport.FormulaSyntax = 0
oReport.RecordSelectionFormula = FilterSql
'oReport.PaperOrientation = crPortrait
CrystalActiveXReportViewer1.ReportSource = oReport
'CrystalActiveXReportViewer1.Refresh
'CrystalActiveXReportViewer1.RefreshEx (True)
CrystalActiveXReportViewer1.ViewReport
Delay 1 'give report time to load otherwise it fails if user clicks on combo twice while reportviewer is loading
lvwOldNotes.Enabled = True
'Set oApp = Nothing
'Set oReport = Nothing
Exit Sub
LoadReport_Error:
errmsg "The following Exception occured : " & ERR.Description & ", " & ERR.Source & "", "Exception occured in frmItemManager.LoadReport()"
End Sub
Problem is everytime I click on the listview the data for that goods delivery note should come up. I have a command inside my designer to select the desired fields.
One of the fields display - "Goods Delivery Note" or "Goods Received Note"
When I click on the listview to bring up the contents of the selected note, sometimes the entire text "Goods Delivery note" appears correctly, other time just a "g" appears in that textbox.
What could be the problem here. Please help me.:confused: