Datasources

edited 3:20PM in FastReport 4.0
Hi,

First, apologize for my english... i'll try to be as clear as i can...
I'm working on FastReport4, I've made 2 datasources (let them called "DS1" and "DS2")... i'd like to make a 3rd DataSource : "DS3" wich use the data from "DS1" and "DS2" but i don't know how is the syntax to use them in "DS3".

Does somebody can help me [img]style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0" alt="unsure.gif" /> Thanks.[/img]

Comments

  • gpigpi
    edited 3:20PM
    Try to use TfrxUserDataset
  • edited 3:20PM
    Say a few words more about all three datasets and tell what parts of them you want to combine and which Databands you plan to use for those datasets (TfrxADOQueries ?).

    Mick
  • edited 3:20PM
    I use 2 IBXQueries. In which one there is a numeric field (a price). I'd like the third IBXQuery to calculate the difference between the two prices (for each rows). The link between the 2 firts IBXQuery is a unic field containing an order's number.
    I don't know if I'm really clear so there is a "graphical" explanation :
    QUERY1:
    OrderN?° Price
    1234 248
    1452 132
    7485 784

    QUERY2:
    OrderN?° Price
    7485 453
    1234 250
    1452 122

    QUERY3: (like i want it to be)
    OrderN?° Delta
    1234 +2
    7485 -331
    1452 -10

  • edited 3:20PM
    Your example is quite clear [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Where do you plan to put values of these queries? Which of them will be the root for any MasterData band? Will it be the third query? If so then you can use a standard FR script[/img]while not Query3.Eof loop and read data from other queries inside this loop. It is possible but a bit complicated.

    Other solution - is it possible in your case to construct the third query to hold all the information like:

    SELECT a.Price1, b.Price2, (a.Price1 - b.Price2) as Delta
    FROM table1 a, table2 b
    WHERE ...


    Mick
  • edited 3:20PM
    I tried the 'Other solution' but it doesn't work... I suppose that the problem comes from the syntax.
    a.Price1 is not recognized in my request, i tried to wrote it : [a.Price1] or <a.Price1> or <a."Price1"> but it seems that it doesn't work anyway.
    I don't know if i have to use the IBXDataset name or IBXDataset username... I get lost >
  • edited 3:20PM
    wrote:
    I suppose that the problem comes from the syntax.
    a.Price1 is not recognized in my request, i tried to wrote it : [a.Price1] or <a.Price1> or <a."Price1"> but it seems that it doesn't work anyway.

    My select statement was only the idea to follow and to convert it to your database syntax.
    Write here both full select statements you use to get results which you showed in a graphic form. It will help me to understand your issue.

    Mick

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.