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

Formating Text in a JIT control

edited December 2005 in End User
I added a JIT item that I called 'footer'. This will put in as the text:


ReportName PageNo/PageCount DateTime

I want the Report Name on the Left PageNo centered and date right justified.
The end-user should make the field the entire width of the report (I would
like to make that happen automatically when it is dropped on the form, but I
can't find an event for when it is dropped).

I can put these values in the Text of the JIT control, but I do not know how
to space them out.

I was thinking I could write to the canvas of the TppDBText control, but
there is no canvas for TppDBText.

Is there a better way to accomplish this? Or do you know how to write to the
canvas?


Thanks in advance,
Rob

Comments

  • edited December 2005

    Please see the JITPipeline tutorial in the ReportBuilder Developers Guide
    and the JITPipeline demos included with the RBuilder\Demos\Reports\Demo.dpr
    project.

    You need to define three fields for the JITPipeline: ReportName, PageNo,
    DateTime. Then inside the report designer, use 3 DBText components.

    The TppDesigner.OnCreateComponent fires after the component has been added
    to the report layout.




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2005
    > You need to define three fields for the JITPipeline: ReportName, PageNo,
    I don't see why I would need JIT to do this. I would just put three system
    variables on the form in the report designer.

    What I am trying to accomplish is creating ONE JIT Field that would hold
    would be formatted in such a way that part would be on the left, part in the
    middle and part on the right.

    This way the end-user could put one of these in the footer, and we would
    take care of putting in the correct data and formating it.

    I have many other JIT fields and I know how to use the GetFieldValue event.
    I just don't know how to write the data to the field so it is justified the
    way we want it.

    -Rob
  • edited December 2005

    Conceptually, a datapipeline (JITPipeline, DBPipeline, etc.) contains data
    fields that can be bound to data-aware controls. The data-aware controls
    read the contents of the datafield: String, Integer, etc. and perform
    formatting and rendering. It is possible for the data to contain
    formatting - but then you need a special type of data-aware control to read
    the formatting and render it. The DBRichText component works in this manner.
    It reads a datafield that contains rtf data and uses the formatting info
    embedded in the rtf data to render the output.

    Based upon the description of what you want the end-user to be able to do, I
    can think you need to create a new type of component that can be installed
    to the ReportDesigner's Component Palette. This component could be called
    'Footer'. I can think of a few ways to try to approach this:

    1. One way to do this is to create a special subreport descendant. Check out

    RBuilder\Demos\3. EndUser\5. Dynamic Subreport Loading

    2. Similar to above, except create a descendant of TppRegion that creates
    three child objects (these could be 3 SystemVariables as you mentioned
    before). Default the region to ParentWidth of True.

    3. Use the formatted data access approach - for this you need a special type
    of component to do rendering.





    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.