Switch table name on the fly.

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Sam_(Guest)
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

Switch table name on the fly.

Post by Sam_(Guest) » Wed Dec 22, 2004 11:19 am

We are a Visual Foxpro 8.0 shop. We use R&R for some of our reports.____We are trying to have R&R look at another table other then the one that is in the setup dialog box by creating the config file on the fly coded in Visual Foxpro.____We have one master table and one child table. Switching the child table is what we are interest in.____Do we need to use the ri_* variable? If so, we are familiar with ri_master, but what ri_* variable do we use for the child table?____any help/hint is appreciated.____Thank you

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Switch table name on the fly.

Post by kfleming » Wed Dec 22, 2004 3:40 pm

To change a related table you would use one of the RI_ALIASnn fields.__In this field you enter the alias name that is used for the related table you want to switch and then an equals sign. After the = you enter the path/name of the new related table, then the new related index and then any index tag.____For example:__ORDFILE=C:ORD2004CUSTORD.DBF,C:ORD2004CUSTORD.CDX,CUSTNO____The syntax is described in the Help file.____Kathleen__R&R Support

Sam_(Guest)
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Switch table name on the fly.

Post by Sam_(Guest) » Wed Dec 22, 2004 4:47 pm

>To change a related table you would use one of the __>RI_ALIASnn fields. __>In this field you enter the alias name that is used for the __>related table you want to switch and then an equals sign. __>After the = you enter the path/name of the new related __>table, then the new related index and then any index tag. __>__>For example: __>ORDFILE=C:ORD2004CUSTORD.DBF,C:ORD2004CUSTORD.CDX,CUSTNO __>__>The syntax is described in the Help file. __>__>Kathleen __>R&R Support ____Thanks Kathleen.____When you say RI_ALIASnn field, what is RI_ALIASnn referring to?__How do I know what "nn" is?__Does you example belong in a config file somewhere?__

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: Switch table name on the fly.

Post by kfleming » Thu Dec 23, 2004 8:48 am

The fields you can use are RI_ALIAS1, RI_ALIAS2,...RI_ALIAS99____Kathleen__R&R Support

Frazkrer
Posts: 0
Joined: Sun Apr 15, 2018 2:26 pm

====> RE: Switch table name on the fly.

Post by Frazkrer » Thu Dec 23, 2004 5:27 pm

Sam and I have tried the following line in the text control file we are specifying in the call to RRWRUN:____table1 = x:data able2.dbf,x:data able2.cdx,tagname____Table1 is actually the 3rd table referenced in the Relations dialogue when designing the report.____Or problem is this report is being run in a multiuser environment and must be able to pull data from different tables each time or even simultaneously when run by different users. Therefore, using fields in a control table is not an option for us.____We know we are utilizing the text contol file properly because we are using it to specify the report name and are successfully changing the master table by using ri_master = x:dataNewMaster____Any help would be appreciated. The boss is getting testy!____

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=====> RE: Switch table name on the fly.

Post by kfleming » Fri Dec 24, 2004 8:04 am

If each user would need a separate table you would need a separate control file for each user.____Kathleen__R&R Support

Frazkrer
Posts: 0
Joined: Sun Apr 15, 2018 2:26 pm

======> RE: Switch table name on the fly.

Post by Frazkrer » Mon Dec 27, 2004 10:55 am

We are using FoxPro to create a separate control file for each user before it calls the report. This is an example of the text in the control file that is not working:____ri_report = H:k12004data4K12.RRW__ri_master = H:k12004datak1cap2__ri_printer = ?__k1foot=H:k12004datak1foot2,H:k12004datak1foot2.cdx,XKFPCSYQ____It calls the 04K12 report as specified. It uses K1cap2 as the master table instead of K1Cap. However, it does not use K1Foot2 in place of K1Foot. The report runs and pops up the screen, asking the usr Screen, Printer, etc.____Thanks for your help,____Susan

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=======> RE: Switch table name on the fly.

Post by kfleming » Mon Dec 27, 2004 12:38 pm

You need to edit the k1foot line to read:____RI_ALIAS1=k1foot=H:k12004datak1foot2,H:k12004datak1foot2.cdx,XKFPCSYQ____Kathleen__R&R Support

Frazkrer
Posts: 0
Joined: Sun Apr 15, 2018 2:26 pm

========> RE: Switch table name on the fly.

Post by Frazkrer » Mon Dec 27, 2004 3:00 pm

That did it.__Thanks!

Post Reply