Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distrib Rpt picks up records from other open reports! Why!?? 1

Status
Not open for further replies.

sgoodwin

Programmer
Jul 31, 2001
8
US
I have a VB App that uses Crystal (8) for output. The app is distributed and runs on MS Terminal Server. The report is a simple one, one that uses an ID parameter to look at a single table to open a report of one record. The problem is, when there are two users logged in, each user will get each others' report TOO. There is only one database (Sybase), but the app runs on four Terminal Servers. This happens even when the users are on DIFFERENT servers. The table in question is a temp table that has the individual record being reported upon deleted in the line of code following the line that launches Crystal. I suspect something like a temp file somewhere or something, but I'm running out of ideas.

Any help will be sincerely appreciated.

sgoodwin@astenjohnson.com
 
My guess is that the app doesn't get to that line while CR is open. So the line doesn't get deleted until the report is closed. Sounds like this is a single permanent 'temp' table that has records added and deleted. If you can't give each instance a separate temp table, you can add a time stamp or other identifier to the temp record, and pass that to your selection formula so that you only get your own data. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken -

You've missed the mark. The code past the line that opens Crystal definitely executes immediately after the line above it, proven by the inclusion of a messagebox there. Further proven through querying the database with reports open. Something somewhere is storing this information, and it's not VB, and it's not the database. The database already has aunique ID for each record, and this is the "crystalreport1.selectioncriteria", and it doesn't work. Long after the record is deleted and the control no longer in use, others running seperate reports on other *servers* are gettting the same data that appears in report #1.

Still baffling.

SWG
 
I am stumped on that one. Do they get the old record in addition to their own record, or instead of their own record?

I don't know much about the terminal server, but it sounds like the reports are sharing the same instance of the CR recordset in memory.

Is the connection from CR to this temp table SQL/ODBC Based?
Which CR integration method are you using? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Users get their record plus any other records from reports currently being previewed. There's certainly some kind of RS instance-ownership issue, but how to stop this?

The connection is ODBC using Sybase's 11.2 driver. I have no idea what "CR Integration Methods" are.


 
For a list of CR integration methods, see the FAQ in the general forum on what info to include in your question.

Also, the command you gave for selection formula isn't correct in any integration method. Can you post the line of code you use to pass the selection formula? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
CrystalReport1.SelectionFormula = "{inv_data.master_id} = " & goInvoice.MaxSequenceID
 
That syntax doesn't look right. Did you figure out which Integration method you are using? If you post the line of code that launches the report, I can usually tell. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I'm using the OCX. Crystal 8. VB6 SP5. NT Terminal Server v?.
 
Are you sure that the selection formula is getting passed? I use:

report1.ReplaceSelectionFormula (your formula)

If you pass a literal string to CR, then make sure that you are passing the literal quotes around the value. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Of course the selection formula is getting passed. How else would the correct record show up in the report, and the correct record in the second report as well?

Are you saying you think this is because Crystal is somehow building its own 'or' statement? That seems a bit odd, don't you think?

 
If there is (usually) only one record in the file at a time, no selection formula would be needed. Just a thought, since I didn't recognize your syntax.

Sorry, I don't know where else to send you.
You could try the CD knowledge base, but that is an unusual problem. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top