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

Some evaludation Questions

edited January 2004 in General
Hi,

As I've been evaluating the demo version of RB, I have a few queries I was
hoping someone can help me with:

1) Borders / Band Lines.
In my previous designer, it was possible to put a border on a band. (The
most common thing I used to do here, was place a 'bottom' border on a band,
so it would print a line after that band had finished printing. In RB, it
would appear as though the band hasn't this option.

I understand that you can place a shape, and have it match the width and
height of the band - but this is no good if I want to just print a bottom
(or underline) border at the bottom of the band.

I'm also aware that you can place a Line component at the bottom of the
band. But in doing this, I can't have it 'automatically follow' the band if
I resize it.

I guess my question for this is either:
a) Is there a plan in the future to add a bordertype property to bands,
or
b) Is there a way to allign a line component to the bottom of a band.
(Although I'd much prefer to hear 'yes' to 'a' above. :-)


2) Pagesize Default
Is it possible to change the preferences of a report, so every report that I
create automatically starts with an 'A4' page size, instead of having to
manually change this after I create a report? (Or does this require source
code modificaiton?)

3) Custom Variables
I haven't been able to find any custom variables when it comes to data
labels. In the past, I have had the ability to add data labels to the
report, which I can use calculating labels to sum up those amounts, without
having to put a calculated field in a TDataset.

I've noticed that you can add manually fields to a TppxxPipeline component,
but can't see how one would change the value of that field. I've tried
calling the field directly, but get the compilation error 'Cannot assign to
a readonly property'. ppDBPipeline1ppField1.Value := 1;

The reason for this is that sometimes I have used one TDataset for numerous
reports, in which each report has a unique way of calculating different data
which is seperate from the TDataset.

I guess my question for this one is:
Can I assign values to a report which calculate on a level I specify
(ie - which band), and total those values up at the end of a report using a
calclabel?

4) Orientation of Components on Report
How can I rotate a label so it prints 30, 45 or 90 degrees to the
horozontal? Also - how can I print diagonal lines on a report?

5) Page Border
Is it easy to create a border for the entire page, or must I use a PageStyle
band to do this? (All I want is a simple line around the entire page).
If a PageStyle band is required, is it easy to Add a PageStyle band during
runtime, and add this there? (As many of my reports will require this, and
I'd prefer to make a call to a procedure to create the band for each report,
rather than having to change each report manually during design time).

6) Modifying the Default Preview Dialog
Is it possible to modify the default preview dialog with the demo
components, or does one require the source code to do this?


I know I've got a few questions here, but I'm getting rather keen on
ReportBuilder, and just want to make sure I can do everything I need to do
before committing myself. Thank you for the support you've already given me
so far.

Thanks & Regards
Adam Hair
Wimmera Software Development
Horsham, Victoria, Australia

Comments

  • edited January 2004
    Hi,


    Well, you can select "Report" - "Footer" to insert a footer band...,
    not shure if this is what you wanted?

    b) You can - simply set the shape's ShiftWithParent:=True




    Have you had a look at TppDBCalc (you'll find it within the designer
    next to the other data aware components within the toolbar)? Or take a
    TppVariable and handle it's OnCalc-Event.



    Of course you can define a variable for your delphi form, assign a
    handler to the BeforePrint-Event of the detail band and calculate a sum:

    procedure TMyForm.DetailBandBeforePrint(Sender: TObject);
    begin
    // Variable is defined within TMyForm
    MySum:=MySum+TMyTable.FieldByName('MyValue').AsInteger;
    end;

    ... well - actually there seems to be a bug in RB: in case you have
    more than one Group in your report, this handler might be called more
    than once while page breaks occur - there'll hopefully be a fix for
    that within the next days. Until this time I workaround checking an
    AutoIncrement-Field:

    procedure TMyForm.DetailBandBeforePrint(Sender: TObject);
    begin
    // Variable is defined within TMyForm
    IF TMyTable.FieldByName('ID').AsInteger<>LastID THEN
    MySum:=MySum+TMyTable.FieldByName('MyValue').AsInteger;
    LastID:=TMyTable.FieldByName('ID').AsInteger;
    end;



    ... yes it is ;-)

    Refer to page 117 of the Developers Guide.



    I'm just using RB for a few weeks - and despite from this little bug I
    mentioned the only thing I missed until now is a "avoid orphaned
    header"-Feature, that yould be more than "KeepGroupTogether" as it
    wouldn't check if the whole group fits on the rest of the page but if
    at least one detail band does...

    Some of the other questions were answered earlier in this newsgroup -
    you'll have to look for them on your own or wait, until the
    "professional" support will answer your posting ;-)

    Kind regards,

    Mark
  • edited January 2004
    Hi,


    forget about that workaround - RB doesn't calculate a single entry
    double but the whole last page if the user skips to it within the
    report directly. This is a part of my Debug-Log, showing for which ID
    the variables OnCalc-Event was called and what value was added to the
    sum - I waited a few seconds before clicking "goto last page". ID 25 is
    the first to be displayed on the last (second) page (though it was
    called one time before I clicked "Last page":

    [...]
    22.01.2004, 13:44:10.939: Addiere ID=15 -> 29,0
    22.01.2004, 13:44:10.939: Addiere ID=16 -> 29,0
    22.01.2004, 13:44:10.986: Addiere ID=25 -> 0,5

    22.01.2004, 13:44:20.174: Addiere ID=20 -> 28,9
    22.01.2004, 13:44:20.190: Addiere ID=21 -> 10,0
    22.01.2004, 13:44:20.190: Addiere ID=24 -> 10,0
    22.01.2004, 13:44:20.205: Addiere ID=26 -> 8,0
    22.01.2004, 13:44:20.221: Addiere ID=25 -> 0,5
    22.01.2004, 13:44:20.237: Addiere ID=20 -> 28,9
    22.01.2004, 13:44:20.252: Addiere ID=21 -> 10,0
    22.01.2004, 13:44:20.252: Addiere ID=24 -> 10,0
    22.01.2004, 13:44:20.268: Addiere ID=26 -> 8,0

    So In this case you've to add more than one group - be aware of that!

    Kind regards,

    Mark
  • edited January 2004
    Hi Adam,

    1. There is currently no plan to add a border feature to the bands of
    ReportBuilder although we take all of our customers' requests seriously and
    if we find that there is a need for such a feature, we will consider adding
    it.

    As for now, you can keep any component in its relative position on the
    detail band by setting its ShiftWithParent property to True. This is a
    published property and can be accessed from the Delphi Object inspector.
    Placing a line at the bottom of the detail band with the ShiftWithParent
    property set to True will keep that line at the bottom as the detail band
    grows. If you need to only place a line at the bottom of all your detail
    bands, let me know, I have an example that will help you.

    2. The default paper size is set to either Letter or A4 depending on your
    windows regional settings. So in short... Yes, you will need to change the
    ReportBuilder source although it will be very quick and easy. The source
    you will need to change is in the constructor of the TppPrinterSetup class
    located in the ppPrintr.pas file. It is a simple matter of changing the
    default page width and page height. Let me know if you need more help with
    this.

    3. ReportBuilder has two components. The TppDBCalc and TppVariable can be
    used to make calculations on given fields in your dataset. The TppDBCalc
    component contains some built in functionality that enables you to show a
    sum for instance of a column. The TppVariable is much more customizable in
    that you are in charge of your own calculations which must be made in the
    OnCalc event of that component.

    4. There is an add-on component named RotatedText available free of charge
    from our web site that allows the rotation of Labels in ReportBuilder. You
    can download this, along with many other add-on components for ReportBuilder
    from the following web address. Unfortunately there is currently not a way
    to create angled lines, shapes or images.

    http://www.digital-metaphors.com/Subpages/Downloads/companionproductsRCL.html

    5. To create a page border, you will need to either use the page style or
    place lines along the outside borders of each band in your report. Creating
    bands and components in code is very simple. Please see the attached
    article below for more information.

    6. Yes, it is possible to create a custom preview form by creating a
    preview plugin. I have also attached an article about this, and you can
    download an example preview plugin from the link below.

    http://www.digital-metaphors.com/tips/PreviewPlugIn.zip

    ---------------------------------------------
    Tech Tip: Create Reports in Code
    ---------------------------------------------

    A ReportBuilder report is composed of a set
    of components. Like other standard Delphi
    components, the components which make up the
    report layout have a run-time interface.
    That is they can be created and configured
    using Object Pascal code.


    A complete example of creating a report entirely
    in code is contained in the Developers Guide.

    The Developers Guide is located in the
    ..\RBuilder\Developers Guide\ directory.

    -----------------------------------------
    Article: Creating a Preview Plugin
    -----------------------------------------

    Q: I've followed the tutorials and registered a Preview Form replacement but
    that did not affect the TppDesigner's Preview workspace.


    A: Do not use the form replacement, but rather, there is a different
    architecture built into the preview form that is registered by default.



    You will need to register a TppPreview descendent. The class you register
    is used to create the preview controls inside the standard print preview
    form and the designer preview workspace.


    Here is an example of creating a simple custom preview that access the
    viewer its been assigned in order to change the page color. You can also do
    more advanced operations such as adding and removing buttons and change the
    behavior of the preview form. Access the inherited controls via. protected
    properties and override the virtual methods in order to customize behavior.

    Open ppPreview.pas and view the TppPreview class as a guide to create a
    custom preview descendent.


    unit MyPreviewPlugin;

    interface

    uses
    ppPreview;

    type
    TMyPreviewPlugin = class(TppPreview)
    public
    procedure BeforePreview; override;

    end;


    implementation

    uses
    Graphics;


    procedure TMyPreviewPlugin.BeforePreview;
    begin
    inherited BeforePreview;

    Viewer.PageColor := clRed;

    end;

    initialization
    TppPreviewPlugIn.Register(TMyPreviewPlugin);

    finalization
    TppPreviewPlugIn.UnRegister(TMyPreviewPlugin);

    end.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2004
    Hi Mark,


    Not quite. At the moment, by Nico's reply - it would appear as though a band
    border property will not be included in the near future. (Unless a lot of
    people want it ) The workaround is to put a line at the bottom of the
    band, or a box, and make it grow to the total height and width of the
    report.


    Thanks.



    I had seen the TppDBCalc, but totally missed the TppVariable. The
    TppVariable is exactily what I wanted! These guys think of everything....
    except border properties for bands. ()


    - Thanks for that. I think the TpPVariable again above is what will
    help me with this too!


    Ta.


    Thanks for your reply Mark - appreciate it!

    Best Regards

    Adam.
  • edited January 2004
    Hi Nico,

    Thanks once again for your detailed reply. Muchly appreciated!


    I have my windows regional setting set to 'Australia'. Here we normally use
    A4, but when I plop a report onto my form, it defaults to Letter. Can you
    please inform me where I'm going wrong.

    I'd much prefer for it to automatically be done through the regional
    settings, than through the changing of the source code. (Only because it's
    possible )

    with

    Yes -I don't have the source code..... yet. :-) (Still demo'ing :-).

    be
    in

    I've checked these out... and love these components - especially the
    TppVariable!


    Thanks very much - these components look great, and very helpful!

    or images.

    I have thought of a workaround (but don't like it too much ). It would be
    to put an image on the form, of a bitmap with a diagonal line.

    Would it be a hard thing to add new properties to the Position property, so
    we could have TopLeft-BottomRight and TopRight-BottomLeft in your next
    release?


    Thanks for the example. In my situation, I'm probably going to want to
    design a complely new form from scracth. Trying to do this via pascal code
    (without access to the form) would appear to be tedious. Is it easy enough
    to create a previewplugin from a dfm as well as pas. (So I can visually
    design my preview on a form?)

    Lastly - Nico, my utmost thanks again. With my current evaluation of your
    product, so far I have been happy with the product. However, product alone
    is not good enough for me. I value support as much as the product itself,
    and so far I have been very happy with the support you have provided! The
    more I evaluate your product, and receive the support I've been getting, the
    more satisfied I'm becomming with the decision I will be making.

    Best Regards

    Adam.
  • edited January 2004
    Hi Adam,

    - Looking at the source, it seems as though ReportBuilder decides whether
    to set your default paper size to Letter or A4 based on the Decimal
    Separator you currently use. If you use a period ".", the default is set to
    Letter, anything else and your default is A4. This was probably done to
    capture the most countries at once that predominantly use A4 paper. Though
    I cannot make any promises, I will mark this down as an enhancement for the
    next release.

    - Angled lines are currently on our to do list for future enhancements.
    Currently we are working to allow ReportBuilder to be used with Borland's
    latest release of Delphi 8. This has turned out to be a complicated and
    involved process.. Once this is done, we will be able to focus on future
    enhancements and feature upgrades.

    - It is possible to create a custom preview form completely from scratch
    visually by using the method described in the ReportBuilder Developer's
    Guide (\RBuilder\Developer's Guide\...) on page 117 as Mark described. In
    fact, all forms in ReportBuilder with the exception of the Designer are
    replaceable. If you do decide to go with our product, you will see by
    looking at the current TppPreview source that the preview window is
    essentially nothing more than a TppViewer component on a form with
    navigation and zoom capabilities.

    - Always glad to help. Good luck with your reporting!

    --
    Best Regards,

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