Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

the real output paper don't math the priview screen?

edited February 2004 in General
hi all
I put two ppimage in my detail band and load the real pic path-name in the
DetailBandBeforeGenerate event.
The programe code seems like the below lines.
======================================================================
procedure Tppckrpt_frm.ppDetailBand1BeforeGenerate(Sender: TObject);
var
index1: integer;
index2: integer;
begin
if(row_times >= row_count)then exit;
index1:= row_times * 3 + 1;
index2:= row_times * 3 + 2;
ppimage1.Picture:= nil;
ppimage2.Picture:= nil;
if(buff_count >= index1)then ppimage1.Picture.LoadFromFile(buff[index1 -
1]);
if(buff_count >= index2)then ppimage2.Picture.LoadFromFile(buff[index2 -
1]);
ppimage1.Stretch:= true;
ppimage2.Stretch:= true;
inc(row_times);
end;
======================================================================

When I press the press the "print" button to do the following code,
the preview screen pop up and everything seems all right.
But when I press the print button(the report builder build-in function) in
the priview screen,
The output paper don't match the priview screen. What I see isn't what I
get.
Forexample, I have four pic, the paper in preview state I see is
pic1 pic 2
pic3 pic 4
but the paper in printer state state I see is
pic1 pic2
pic1 pic2
The pic3 and pic4 are disappered.
How to slove the problem?
Thanks
======================================================================
row_times:= 0;
if(buff_count > 0)then begin
row_count:= 0;
row_count:= buff_count div 2;
if((buff_count mod 2) > 0)then inc(row_count);
ppJITPipeLine1.InitialIndex:= 1;
ppJITPipeLine1.RecordCount:= row_count;
ppReport1.Print;
end;

======================================================================

Comments

  • edited February 2004
    Hello,

    This behavior is usually caused by the processing of data or addition of
    components during report generation. If possible, try moving the event
    handler code below to a different event, or better yet find a way to process
    this information before the report is printed.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2004
    Thanks Nico Cizik
    What event is suitable?


  • edited February 2004
    Hello,

    You might try using the Report.BeforePrint event. If this still gives you
    problems, you may have to make these changes before the call to Report.Print
    is made.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2004
    Hi Nico Cizik
    I don't know what you mean?
    The DetailBandBeforeGenerate event is fired many times depending on the
    amount of data.
    But The BeforePrint is fired only one time.
    How can I exchange my code from DetailBandBeforeGenerate event to
    BeforePrint event?
    Thanks


  • edited February 2004
    The reason you are seeing a difference between the screen output and the
    printer output is that you are processing information during report
    generation. My suggestion would be to test different events available in RB
    and try to get a result that is suitable for your needs but it is impossible
    for me to tell you what event to use as every situation like this one is
    different. This may ultimately require you to change the way your report
    looks/runs.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2004
    hi Nico Cizik
    May I have your private e-mail account?
    I want to mail you a demo of my problem.
    My e-mail is jck1@unimaxtech.com.tw.
    Thanks

  • edited February 2004
    Hi,

    Please e-mail the demo in .zip format to support@digital-metaphors.com and
    I'll take a look at it for you.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.