Normal Topic Accessing Multiple Databases in One Report (Read 689 times)
bobvandy
Member
*
Offline



Posts: 5
Joined: Jan 29th, 2011
Accessing Multiple Databases in One Report
Feb 15th, 2011 at 3:02am
Print Post Print Post  
I have two simple databases that are Relational linked, how do I go about generating a report (columnar in this case) and access data from both databases. I find mention of a sub report in the users manual, but I can't figure out how to use it. This is my first go at a report.

Thanks,
Bob Vandermark
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Accessing Multiple Databases in One Report
Reply #1 - Feb 15th, 2011 at 3:37pm
Print Post Print Post  
Hello Bob,

To create a subreport what you need to do is design a report in your sub-database that displays the information you want to display. Then design your report in your parent database that shows the information you want to show from the parent database. Then in the group Body add a subreport element using the layout element adder. When you add the subreport element to the report you will be prompted to pick the report to display and the link of the records to display.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
bobvandy
Member
*
Offline



Posts: 5
Joined: Jan 29th, 2011
Re: Accessing Multiple Databases in One Report
Reply #2 - Feb 16th, 2011 at 10:01pm
Print Post Print Post  
Ray,

I created the subreport and added it in. I can get the report to now pull data from both databases, but not in the format I want. I am using an old database for keeping track of music CD's and am using this as a learning tool for Sesame. One database contains the CD data with location information and the other has each song on the listed and linked to the first database.

What I am looking for is a columnar report that lists all of the songs in alphabetical order with selected details and a couple of bits of information from the first database, such as the CD title and a location detail. Currently the report groups items by fields from the main database.

I apologize if this is covered in the manual, but I have read what I can find on this, but cannot find a section that addresses it.

Thank you for the support!

Bob
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Accessing Multiple Databases in One Report
Reply #3 - Feb 18th, 2011 at 7:04pm
Print Post Print Post  
Hello Bob,

Okay I see what you are after now. To create a report like this what you want to do is create the report in your song database, sorted alphabetically by song title. Be sure to add the element that you are using as the relational link between the parent and child records. Then in the Group Header add a static text element for CD Title and another for Location. In the group body add two unbound value boxes named CDTitle and Location. Now on the left hand side under commands click on Program Layout. Under element choose CDTitle. Enter the following program(You may need to change some names as I do not know what you have named things in your file)

CDTitle = @XLookup(@FN, CDNumber, "Cds!CDNumber", "Title")
Location= @XLookup(@FN, CDNumber, "Cds!CDNumber", "Location")

In the above programming the first CDNumber is the name of the element in the report that has the value that is used for the relational link to the parent. The "Cds!CDNumber" is actually two pieces of information. "Cds" is the name of your parent form, "CDNumber" is the name of the element on the parent form that has the value in it that is used for the relational link. The exclamation mark is required to separate the two pieces of data. The last section of each line is the name of the element on your parent form that you want to display the data from, In this case "Title" and "Location".

If you have any questions about any of this just let me know what you have a question about and I will do my best to answer it.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
bobvandy
Member
*
Offline



Posts: 5
Joined: Jan 29th, 2011
Re: Accessing Multiple Databases in One Report
Reply #4 - Feb 19th, 2011 at 12:04am
Print Post Print Post  
Thanks Ray,

I have been having trouble with my computer and I just resolved the issue with HP and its my harddrive that is failing. I managed to get my data off of it (I think I got it all), but it will be another week before I get a new one and then I will need to install and reload. All that to say I will not be able to incorporate your advice for awhile. As soon as I am back up and running I will give it a go.

Thanks for your help and patience.

Bob
  
Back to top
 
IP Logged