VB Crystal Report >> Selection formula ignored (Sometimes)

by martin » Thu, 14 Apr 2005 17:30:17 GMT

Hi,

I've created an VB 6 app and I'm using Crystal Reports 8.5 for the
reporting.
The report must display/print data for the current user.


In VB I'm using the following code to preview the report:

Screen.MousePointer = vbHourglass
gvBigRep.RecordSelectionFormula = "{q_tf10.user_id} = '" + gv_UN +
"' "
crvPreview.ReportSource = gvBigRep
crvPreview.ViewReport
Screen.MousePointer = vbDefault

(gv_UN is the user id of the user)
(q_tf10.user_id is the parameter in the report)

The problem that I have is that the app with the report works fine on
some computers but ignores the formula on others.

The computers are running Win 2000 Pro. I've updated the Windows and
crystal service packs. I'm using MDAC 2.7 on all computers.

I've printed the formula on the report. And it is passes correctly
form VB to Crystal.

The report runs correct out of Crystal when I type in the parameter
value when promted, but is ignored when I type in the parameter
running the VB App.

Why is Crystal behaving like this ? How do I correct this ?

Martin Oosthuizen


Similar Threads

1. Record Selection Formula is Ignored! - VB Crystal Report

2. Chart Ignoring Selection Criteria

I am using crystal reports viewer in visual studio.net.

THIS WORKS
        CrystalReportViewer1.Visible = True
        CrystalReportViewer1.ReportSource = 
Server.MapPath(ViewState("ReportName"))
        CrystalReportViewer1.SelectionFormula = fSetSelectionFormula()

THIS DOESN'T - IT IGNORES THE SELECTION CRITERIA
        CrystalReportViewer1.Visible = True
        Dim MyReport As 
CrystalDecisions.CrystalReports.Engine.ReportDocument
        MyReport = New AvgSupplyConductivityPerTowerCR
        CrystalReportViewer1.ReportSource = MyReport
        MyReport.RecordSelectionFormula = fSetSelectionFormula()

Thanks


3. Shell.Run, sometimes waits for run to finish sometimes does no

4. Shell.Run, sometimes waits for run to finish sometimes does not

This simple script shows my dilemaL

set objWSH=WScript.CreateObject("WScript.Shell")

' this will wait for notepad to exit
objWSH.Run "Notepad doit.txt", 5, True
MsgBox "back from notepad"

' this does not wait for explorer to exit
objWSH.Run "Explorer c:\temp\109",5, True
MsgBox "back from explorer"

I run this and the notepad msgbox won't pop up until I exit notepad.
But the explorer msgbox does pop right away, even though the explorer I've 
launched is still active.

Anyway to make the code wait for the launched explorer.exe to close out ?

Thanks

-- 
Paul Davidson

5. Sometimes (only sometimes) GetPrivateProfileStringA results in can't find Dll entry point in kernel32

6. Macro sometimes runs and sometimes doesn't

I developed a simple set of macros that insert already made files into the 
current document.

Sometimes the macros run and sometimes they don't. All are located in 
normal.dot.

If I "manually" insert one of the files (File/Insert/File), sometimes the 
macros will run subsequently, but not always.

I can't discern any consistent pattern. Any thoughts or suggestions?

7. Sometimes folder renaming code works, sometimes it doesn't ? - Word VBA

8. selection formula results from two unrelated databases

vb .net 200
crystal reports 
Oracl
Acces

Hi, I have all selection formula results needed from the main crystal report, called in the vb form (Oracle db)

I now need to build in the logic in the vb form selection formula to obtain results also from the subreport (Access db)

The two databases are totally unrelated

How do I do this, please

Do I need to dim a second database, with all connection info, in the vb form
Do I then need to add the subreport table/column info to the FillDataset Sub?  Is that how it's done

Thanks for any help on this

-Helen




Inappropriate post
If so, Red Flag it


Check out the FA
area for this forum



 You