Skip parts in db
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
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
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
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.
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
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.
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.