PDA

Click to See Complete Forum and Search --> : Weird Crystal Problem with CrystalActiveXViewer


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:

Hack
Oct 17th, 2007, 08:20 AM
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.Have you been able to determine any consistency (such as a particular item or row or column or something of that nature) in when just the "g" shows up?

Nitesh
Oct 18th, 2007, 12:48 AM
HI Hack,

Unfortunately it happens randomly. It's driving me insane.:mad:
In one project I used the same code and everything works great. In this project I am having a problem:confused:

Nitesh
Oct 30th, 2007, 12:59 AM
Hi Guys,

Turns out it was the ODBC 5 connector causing the problem. when I switched to ODBC 3.51 everything is working perfectly.:)