Page 1 of 1

How Can I Create a Distance Chart from my DB

Posted: Thu Jul 15, 2010 1:52 pm
by Dzynr
I guess first off I should tell you "I'm not a programmer". My boss has asked me to create an interface or window where I can type in the name of a city, and have the distance (from Toronto, Canada) appear in some sort of box. I have all of the city names and all of the distances as a file on my computer. We are a courier company and at the moment we have loose-leaf bynders with 40 pages of city names and their distances, but he would rather have the info available on our computers for ease of use and faster look-ups. I just need to know if I create a chart or a data base or a query etc.
Any help would be greatly appreciated!! :crazy:

Additional Info for Create a Distance Chart

Posted: Thu Jul 15, 2010 4:12 pm
by Dzynr
I think I'm confusing people with a wordy explanation for a Distance Chart. All I need is to know how to create a window where I can type in one field and have an amount appear in a field beside it. I have all the info on my computer but need a head start as to what app within OOo to use.
My final outcome will be to type in a city name on the left side and have the distance (from Toronto) appear in a field on the right side. I have all the city names and distances on my pc.

Thanks again for any help.

Dzynr

Re: How Can I Create a Distance Chart from my DB

Posted: Thu Jul 15, 2010 4:35 pm
by acknak
I have merged your topics. Better to keep questions on the same topic together.

Re: How Can I Create a Distance Chart from my DB

Posted: Thu Jul 15, 2010 5:46 pm
by RPG
Hello

You did not describe how the data is stored in your database?

Romke

Re: How Can I Create a Distance Chart from my DB

Posted: Thu Jul 15, 2010 6:12 pm
by Dzynr
Hi RPG ...

At the moment I am merely imputting city names in one column and the distances in a second column and assigning an ID to each row. I have just begun this process and will make any changes necessary for this project to happen.
Thanks for your reply.

Re: How Can I Create a Distance Chart from my DB

Posted: Thu Jul 15, 2010 7:41 pm
by RPG
Hello

I understand it as
you make a list
ID , Placename,Placename,Distance

Then you have only to search for that two place names

Use the Basetools of Benitez
See here for an example.

An other idea more base on forms and SQL is select first one place name in a form then the second place name and in a lower subform display the result.
http://user.services.openoffice.org/en/ ... 13&t=27556

In both case it is good first to check if you can find the good result with that method. I think do that also before you input all data.

Romke

Re: How Can I Create a Distance Chart from my DB

Posted: Fri Jul 16, 2010 1:31 pm
by Dzynr
Thanks for the reply Romke. I don't fully understand and guess I will have to do more research before I can tackle this project. I need to be walked through this using baby steps. I think I need to utilize the "forms" part of Base but really don't know where to start.

Thanks again ... but this is too advanced for me.

Christine

Re: How Can I Create a Distance Chart from my DB

Posted: Fri Jul 16, 2010 1:56 pm
by RoryOF
Any geographical route finder that covers the area will do this, such as MS Autoroute. Why reinvent the wheel?

Re: How Can I Create a Distance Chart from my DB

Posted: Fri Jul 16, 2010 7:18 pm
by Dzynr
Hi Rory

You are right ... there are many. I use Google maps when necessary but our initial start point is from our office to destinations around the province. The km count stems from us (in Markham) and not from downtown Toronto as the route finders dictate. We have all of the mileages for quoting purposes, any deviation from that list will give n inaccurate quote.
But I do appreciate your input

Christine

Re: How Can I Create a Distance Chart from my DB

Posted: Sat Jul 17, 2010 4:17 pm
by Arineckaig
At the moment I am merely imputting city names in one column and the distances in a second column and assigning an ID to each row.
Please forgive me if I fail to pitch my reply at the most helpful level. You mention 40 pages of data most of which I guess you have yet to input. Few things are more depressing than typing all that data into an OpenOffice Base table, and then losing the lot which is an all too common experience before you have gained experience with the idiosyncrasies of Base which is the least mature element of the OpenOffice applications.

When I started I found it much safer to enter database data initially into an OpenOffice Calc spreadsheet. Admittedly I was more accustomed to using spreadsheets, but a Calc spreadsheet can be regularly saved as you enter the data and easily backed up.

The great strength of OpenOffice is that its constituent parts work well together. Provided no cells are left empty in your three columns of the spreadsheet, it will be easy to access this data from Base: you can link/register the spreadsheet as the data source for Base forms, queries or reports. There is one proviso: you can read but cannot change the spreadsheet data from within Base. Until you are more familiar with Base that is no bad thing: it keeps the data safe. You can still change or add to the data, but you have to do it in the spreadsheet itself but only when the linked Base is not open and the changes will not be reflected in Base until the Calc spreadsheet has been closed.

If you have already entered a lot of data into a Base table, do not worry. It is easy to copy that data from the Base table into Calc. Open a new Calc file and press f4. If the database file has been registered it will appear in the so-called beamer above the empty sheet. In the left hand box of the beamer select the Base file name and the table name from the list of tables: a copy of the Base table will appear in the right hand box.

Click on the top left gray cell and while all the data is selected drag that gray cell down into the A1 cell of the spreadsheet. Alternately while all the data is selected in the right hand box, right click on the top left gray cell, select copy, move the cursor to the A1 cell and paste. Once the sheet is filled, press f4 to close the beamer and save the Calc file.

In due course enter all 40 pages of data into the spreadsheet. As all the data is quickly visible in the spreadsheet it is easy to spot and correct errors. By typing Ctrl+f you can enter part or all of a City Name and find the mileage quickly. If you sort the data in the spreadsheet by the the City Names you can even search visually. This is a primitive but effective way of meeting your aim.

To link the spreadsheet to Base. You should first check that all the data in the spreadsheet (other than the titles in the top row) are correctly formatted according to the respective columns: text for City Names and Numeric for distances. Open a new Base file. In the opening screen select the lowest radio button against "Connect to an existing database file". In the drop down box just below select "Spreadsheet" and click Next. In the next screen browse to and select your Calc file containing the data and click Next. In the next screen leave the radio button "Yes, register the database for me" selected and "Open the database for editing" checked. Click Finish and save the file with a suitable name. Hopefully the table in the new Base file will match the spreadsheet and will reflect changes or additions after they have been made to the spreadsheet that is subsequently saved.

I suggest that before attempting to create a form in Base to display distance whenever a City Name is typed, you download "Getting Started with Base" to be found at http://wiki.services.openoffice.org/w/i ... thBase.pdf

Again my apologies if this long post tells you nothing that you did not know already and nothing new that you wanted to know. Please come back and I will try to be more helpful when explaining how to set up a form in Base to meet you specific requirement.