Solved

DB Chart Axis Components from ADO

Posted on 2006-11-22
3
411 Views
Last Modified: 2010-04-05
Hi all,

I found an article on about.com that helped me figure out how to set the series to a field that does not appear in the code - however, they have a line of code that I do not understand and cannot figure out the equivalent in my app:

with DBChart1.SeriesList.Series[0] do begin
 DataSource := ADOQuery1;
 XLabelsSource := ADOQuery1Company.FieldName;
 XValues.ValueSource := ADOQuery1SumItems.FieldName;
 YValues.ValueSource := '';
 Marks.Style := smsXValue;
 CheckDataSource;


My Query is ADOQuerySalesman and my field is u_name
It does not have full source, so I am not sure what ADOQuery1Company.FieldName is supposed to represent.  I tried using ADOQuerySalesman.u_name, I tried using ADOQuerySalesmanu_name.Fieldname - I'm not sure what that line represents - can anyone help?  Either with this specifically - or any help with DBChart and how to set it up via code

Thanks all!
0
Comment
Question by:Chipmunk77
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
calinutz earned 125 total points
ID: 18003560
ADOQuery1Company is the name of the field assigned by delphi when you access the ADOQuery in the Object Treeview and on right click select Add all fields.
When you do that all the fields returned by your query (written in design time) will appear there in a fieldname, that usually looks like this:
queryfieldname1, queryfieldname2... and so on... depending on what fields you return with your query.


So a short example:
Query name='myquery'
Query= 'select name, address, date, day from table1'
// now when you go to Object treeview and right click on your query component, choose Add All Fields, and your automatic fields will appear bellow in the treeview as follows:
myqueryname,myqueryaddress,myquerydate,myqueryday

Do you understand now?

0
 
LVL 11

Expert Comment

by:calinutz
ID: 18003611
Instead of using the exact demo of the tutorial you could use an alternative to that assignment such as:


with DBChart1.SeriesList.Series[0] do begin
 DataSource := ADOQuery1;
 XLabelsSource :=ADOQuery1.Fields[0].DisplayName;
 XValues.ValueSource := ADOQuery1.Fields[1].DisplayName;
 YValues.ValueSource := '';
 Marks.Style := smsXValue;
 CheckDataSource;



It should work
0
 

Author Comment

by:Chipmunk77
ID: 18020021
Thanks!  I understand now, that will be very helpful!  :-)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question