Problem with drawing document columns

edited 2:05PM in FastReport 4.0
Hello,

I am using the example from Roberto Nicchi (Drawing document columns) on
26/04/2008 found in the binaries newsgroups and thanks for him.

Here is the code drawing the columns :
procedure draw_columns;
var
  idx:integer;
  obj:TfrxView;
begin
  for idx:=0 to header.objects.count-1 do
  begin
    obj:=TfrxView(header.objects[idx]);
    if obj.tagstr='COLUMN' then
    begin
      with TfrxShapeView.create(body) do
      begin
        left:=obj.left;
        top:=header.height;
        width:=obj.width;
        height:= engine.pageheight-header.height-footer.height;
      end;
    end;
  end;
end;

This procedure is on the OverLay OnBeforePrint event :
procedure Overlay2OnBeforePrint(Sender: TfrxComponent);
begin
  draw_columns;
end;

And here is the code in the footer band :
procedure footerOnBeforePrint(Sender: TfrxComponent);
var i:integer;
begin
if engine.freespace < footer.height then
begin
Engine.CurY := Engine.PageHeight -footer.height -footer.Height;
end;
end;

I put some memos object in the footer band where i drawed a frame
containing these objects.
The problem is i need sometimes to change the height of the footer
band and when i do it, i lost the positions of these objects which must be
mantained in the footer inside the frame.
But there are moved up inside the columns drawed and to avoid this
each time i must add somme values in the the procedure footerOnBeforePrint :
Engine.CurY := Engine.PageHeight -footer.height -footer.Height+250;

and it is not very convenient for me.

Is there any way to do that automatically without adding values each times ?

Thanks a lots.










Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:05PM
    only draw items in the overlay band that will always be in the same fixed position on the output page.
    Generaaly when you start moving objects according to code, you have to write code to position all other objects.
    BTW i dont see you altering the height of the footer band, your code is altering the cury position on the output page.
    also remember that when using overlay bands they are the first to be processed.



  • edited July 2010
    Thanks Gordk,

    I don't know what happened but when i deleted this code in the footer band :
    begin
    if engine.freespace < footer.height then
    begin
    Engine.CurY := Engine.PageHeight -footer.height -footer.Height;
    end;
    

    i haven't had the same problem. And this time the positions of the objects was not changed (moved) (!!??)
    and i am very confused because i was with a problem which was in another context.......
    anyway, i noticed a bit problem :
    when i change the height (manually with the mouse) of the footer band the frame of the memos
    which are in that band are a bit bolded when previewing. Is there a way to maintain by code the memos positions
    according to the footer height ?
    Can i send here a picture of the problem ?

    Sorry for my english i am french spoken
  • gordkgordk St.Catherines On. Canada.
    edited 2:05PM
    "begin
    if engine.freespace < footer.height then
    begin
    Engine.CurY := Engine.PageHeight -footer.height -footer.Height;
    end;"
    this bit of code is setting the cury(the position it is about to output) of the engine if it is less than the freespace to a point which is equal to the page height - 2 X the footer height.

    usually when the freespace is less than bandheight you would want to start a new page.
    Yes you can use gord@fast-report.com.
    run the report and save as an fp3 zip and send both the .fr3 and .fp3 files
  • edited 2:05PM
    I sent you the files
    Thanks Gordk
  • gordkgordk St.Catherines On. Canada.
    edited 2:05PM
    i'll take a look later today or tomorrow.
    BTW when you post in the news groups post in the correct news group or your message may never be seen.
    The binaries ng is for large files demos from all news groups etc.
    You place those files in the binaries ng after posting a message about them in the correct news group.
  • edited 2:05PM
    ok thank you Godk
    and sorry for the incorrect posting
    i will post those files again in the correct newsgroup
  • gordkgordk St.Catherines On. Canada.
    edited 2:05PM
    your .fr3 file is giving me a bad format error.
    please when you attach files either zip or rar them before attaching.
  • edited 2:05PM
    ok iam going to send them zipped in the binaries NG
    Thanks
  • edited July 2010
    I posted them in the binaries NG
    As for the bad format error maybe because
    its containing a password and stored them in a paradox table ?
    i retrieved the .fr3 from the table before
    sending ?

    anyway i deleted password when i sent them in the firts message

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.