Skip parts in db

edited 2:37AM in FastReport 4.0
I have a problem that I can fix..

I get my db from a program (PMT4) and I want to use all data in a table exept the first one..

And another similar problem, if you have 2 graphs in a db how do you get out just one of them?

//Micke

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:37AM
    Need a better explanation of what you are trying to do ?
  • edited 2:37AM
    Ok,

    First: I have a database table with 15 elements. But in the report I don't want the first element (when it's irrelevent) but the other 14. How do I do?

    Second: I have a database with two graphs, If I want both I just use MasterData band and but a picture there, and I get both of them.
    If I change number of records to 1 I just get the first graph.

    But If I just want the second graph, how do I do then?

    was that better?

    //Micke
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 2:37AM
    First:

    In the report script, declare a boolean variable (var pOk : boolean) and initialise it with false.
    then in your databand before print event add this:
    procedure frxmasterdata1onbeforeprintevent(sender..);
    begin
    frxmasterdata1.visible := pOk;
    pOk := true; // once pOk is set to true, it will never go back to false, so it will print all records after the 1st.
    end;

    Solved.

    2nd:
    Do a similar approach. Find what's the situation in which you want each graph to be printed, and put it in the before print event, set its visible property to true or false.


  • edited 2:37AM
    ok..

    I am not so good at the programming part.. I dont generate the report from script (I only control a dialog from script)

    So where am i supposed to place this and what should I put in "Sender"

    //Micke
  • Anu de DeusAnu de Deus Hampshire, UK
    edited July 2009
    In the report designer, you start with 3 pages in your report: code, data, page1.
    Code is your script, it starts blank with just Begin end.
    put this:

    Var pOk:boolean;

    begin
    pOk := false; /// the variable I mentioned earlier, maybe it was a different name, just put the same here.
    end.

    Then go back to your Page1 or whatever it's called, select your masterdata band, go to the events page in object inspector, double-click on its OnBeforePrint event, and then add the code I mentioned earlier in there.
  • edited 2:37AM
    Ok now I have done this

    Var pOk:boolean;

    begin
    pOk := false;
    end.

    procedure frxmasterdata1onbeforeprintevent(sender: TfrxComponent);
    begin
    frxmasterdata1.visible := pOk;
    pOk := true;
    end;

    and have a page with one masterdataband and the table from the database. But I still get the first one.
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 2:37AM
    At this point I can only suggest that you find your answers in the manuals (they are 3 pdfs)
  • edited 2:37AM
    solved it! [img]style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> for whom it may concern in the future. procedure masterdata1onbeforeprintevent(sender: TfrxComponent); begin if (<table>) = '1' then masterdata1.visible := false else masterdata1.visible := true; end;[/img]

Leave a Comment