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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Choosing a table during run-time

Status
Not open for further replies.

Rena

Programmer
May 24, 2000
69
US
I am creating a report to display information from our firewall. Is there some way I can change, on the fly, which file it is reading? For example, we will have daily files and weekly files; all will have the same format. Right now the report points to a specific file but I need to be able to set it up so our operators can choose which file is being reported on.

Thanks!
 
Rena: You can reset the data source of any table in your report in code. The method depends on the approach you are using e.g. Report Design Component vs. Automation Server etc. but have a look at SetLogonInfo - as in the following code snippet from Developer Help

Private Sub Command1_Click()
' Set log on info for the two tables in the report
rpt1.Database.Tables(1).SetLogOnInfo "pdsodbc", "CRSS", _
"pubs", "user1", "password"
rpt1.Database.Tables(2).SetLogOnInfo "pdsodbc", "CRSS", _
"pubs", "user1", "password"

' Preview the report
rpt1.Preview
End Sub David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Hi David,

Thanks for your response. Unfortunately, it is so far over my head I didn't understand it. I looked for 'SetLogonInfo' in Seagate Crystal Reports Help but didn't find anything there. Could you please try again and bring your explanation down a few levels?

Thanks,
Rena
 
Rena: I shall be delighted. However to enable me to be more precise can you let me know what version of CR you are using and what method of report integration (e.g. Report Design Component) you are using? David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Hi David,

Thanks for you time. I am using Crystal Reports Professional V8. Look forward to hearing from you.

TIA,
Rena
 
Rena,

Are you running the report from a VB application? You need to be to do what you are talking about. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Hi Ken,

No, it is a stand-alone Crystal Report. So I guess I am tough-out-of-luck.

Thanks,
Rena
 
Well if they are in the design environment, they can go into the database menu and "set location" to a different table/database. What is the datasource? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Rena: The solution is to upgrade to the Developer Edition (you'll probably get v8.5 now as well) - this version includes the ability to embed reports whereas Professional doesn't. David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
David: Now I have another question. It just sunk-in that I am running the Professional Edition but when I looked at our 'box' we purchased the Developer Edition. We purchased an upgrade from our V7 which was Professional. Will it not upgrade to Developer?

Ken: You mentioned using a VB front-end. I am considering using Clarion as a front-end to call this (and many other reports). I know I can create a screen to get input from the user (which in this case would be the file name). How would I pass that to the CR?

Thanks to you both for your help. Look forward to your responses.

Rena
 
Rena: I suggest you go back to your reseller. The Professional version of V7 did include the ability to embed reports whereas as you know the upgrade to v8 Professional doesn't. You'll need to find out whether you got what you ordered rather than got what you want! David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Sorry,

I know little enough about VB, and nothing at all about Clarion. If you go to the CR Integraton forum, you can ask if someone knows how to integrate with Clarion. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Hi Ken,

I was looking more for how I would set up the CR to accept such input from an outside program.

Thanks,
Rena
 
The only way to do that is to integrate the report into the app. There is no other way to manipulate the report settings. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks Ken. I am just now learning Clarion so I will have to keep that in mind as I go through the tutorial and other courses. Thanks for your time.

Rena
 
Rena: If Clarion is COM based like VB and Delphi then you may find you can use the CR components such as the Report Design Component or the VCL (for Delphi) to enable you to gain access to the CR API. Without this I would switch to VB! David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top