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

Why did Richtext Margin in 6.03 change?

edited July 2002 in General
I converted a lot of reports from 3.52 (D3) to 6.03 (D5). Everything
seems to print as before except for one very annoying thing:

In 6.03 all Richtexts print with a left margin of 1/32 inch, in 3.52 the
margin was 0 inch.

I checked the source and found:

3.52, TppRichEdit.FormatRange

lFormatRange.rc.left := aRect.Left * 1440 div liPixelsPerInchX;

6.03, TppRTFEngine.FormatRange

{add a 1/32 inch left margin (1440 / 32 = 45)}
lFormatRange.rc.left := (aRect.Left * 1440 div liPixelsPerInchX) +
45;


Our reports have a lot of Labels, Memos and Richtext fields left aligned
to a certain position. If I print them with 6.03 they look like as if
the designer of the report trembled while placing the Richtext controls.

Why was the left margin added?
Is there any workaround (please do not answer: add a 1/32 inch offset to
the Labels and Memos)?

Please help as this richtext margin breaks 95% of all our reports.


Thanks
Robert

Comments

  • edited July 2002
    This was added a while ago to address an issue with the alignment of the
    text. A permenant fix would obviously be to shift the richtext components to
    align them. This could be done programatically with a loop like the one
    below. You could also simply comment out the single line of code in
    TppRTFEngine.FormatRange and rebuild.

    for liBands := 0 to Report.BandCount do
    for liObject := 0 to Report.Bands[liBands].ObjectCount do
    begin
    if (Report.Bands[libands].Objects[liBands] is TppSubreport) then
    // recurse
    else if (Report.Bands[libands].Objects[liBands] is
    TppSubreportRichText) then
    // adjust component
    end;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited July 2002
    Alexander,

    thanks for your answer.

    Could you please tell me what kind of alignment issue you addressed by
    adding the left margin?
    It would be useful to know before I recompile the source without the
    extra left margin.


    Thanks

    Robert



    "Alexander Kramnik (Digital Metaphors)" schrieb:
  • edited July 2002
    Actually this wasn't a critical issue. At some point a decision was made
    that the margin was needed for a more visually appealing rendering of
    RichText. You should not enounter any issues by removing the margin.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited July 2002
    Thank you for clarifying this and thanks for your time.

    Robert



    "Alexander Kramnik (Digital Metaphors)" schrieb:
This discussion has been closed.