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

Problems with Report.Parameters

edited October 2004 in General
HI,

I'm using RBEnt 7.03 with Delphi 5.01 Pro and designtime I have problems
when using Report.Parameters.

Try this:

1. New Application

2. Put a TppReport on the form

3. Right-Click the report and enter the parameters-editor (in your source
you see ppParameterList1 appearring).

4. Add a parameter. You see ppParameter1 in your source. Close the
parameter-editor.

5. Open the report designer.

6. Add a TppVariable to the detailband.

7. Right-Click the variable and choose Calculate.

8. Assign some text to Value.

9. Now preview the report. You will see the text you assigned.

10. Switch back to designview .... and ... problems!!!!

Now look again in the source. ppParameterList1 has disappeared!!!!! and
ppParameter1 is still there!!!

When I'm using reports which are much more complex I also get AV's (even
when closing Delphi).

How can I solve this problem?

Ronald

Comments

  • edited October 2004
    Hi Ronald,

    This appears to be a design time only bug with Delphi 5. (In my testing
    with Delphi 6 and Delphi 7, the error could not be recreated). Being that
    this is a design time bug, we are unable to fix it with a simple patch or
    change in source. This will be fixed in the next release of ReportBuilder,
    however as an immediate workaround, we found that if you save your entire
    project down before previewing the report, then moving back to the design
    window, the error will not occur.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2004
    I have a simmilar problem on D7, RB 7.04.

    I create a new parameter but opening the report builder designer erases it.
    I tried saving my project and even restarting Delphi but the parameter still
    gets erased once I open the designer.


  • edited October 2004
    Hi Peter,

    This is not the same issue that Ronald was encountering, nor is it a known
    issue with ReportBuilder. I would suggest performing a corrupt install
    cleanup and reinstalling ReportBuilder.

    --------------------------------------------
    Article: Cleaning up a Corrupt Installation
    --------------------------------------------

    If you have been advised by Digital Metaphors technical support that you may
    have a corrupt installation, or if you are having difficulty installing,
    compiling or running applications after a ReportBuilder install, then it may
    be necessary to manually remove all ReportBuilder files from your system.
    Corrupt installations usually result when you are installing over a previous
    version of ReportBuilder which was not installed into the default directory,
    which was recompiled from the source, or when ReportBuilder files were
    manually moved from the default install location. Cleaning up a corrupt
    installation, consists of locating all ReportBuilder related files, and
    deleting them from your system. The first step is to use the uninstall
    program to remove as much of ReportBuilder as possible.


    Run the uninstall program

    1. Exit Delphi, and all other applications. You should have no applications
    running except the uninstall, otherwise you may lose some of your work.

    2. Select Start | Settings | Control Panel from your Windows desktop.

    3. Double-click the Add/Remove programs icon.

    4. Locate the version of ReportBuilder you wish uninstall and double-click
    it.

    5. The first page of the Uninstall Wizard allows you to choose between an
    Automatic or Custom uninstall. Choose Custom and click the Next button.

    6. Click the Select All button, then the Next button. Repeat these steps
    until you reach the last page of the wizard.

    7. Click the Finish button. All of the items you selected will be removed
    from the system.

    8. After all the ReportBuilder files are removed, you may be prompted to
    reboot the system. If this is the case, reboot the system.


    Delete the ReportBuilder root directory (and all subdirectories)

    1. Using the Windows Explorer, locate the ReportBuilder root directory. The
    default directory is:

    C:\Program Files\Borland\DelphiX\RBuilder

    2. Once you have located this directory, inspect it. If you have any custom
    work in this directory which you would like to keep, move it to another
    directory.

    3. Delete the ReportBuilder root directory.


    Delete all remaining ReportBuilder files

    1. Using the Windows Explorer, search the entire hard drive for all
    occurrences of:

    dclRB*.bpl
    dclRB*.dcp
    rb*.bpl
    rb*.dcp

    2. Delete any occurrences which correspond to the version you are removing.
    All packages are named with the convention NN, where the first number
    is the ReportBuilder version and the second number is the Delphi version.
    Thus, a typical package name for Delphi 5 would be rbRCL45.bpl. The same
    package for Delphi 4 would be: rbRCL44.bpl. Check Installing ReportBuilder
    for a list of the packages associated with each version.

    3. Using the Windows Explorer, search your hard drive for all occurrences
    of:

    pp*.*
    da*.*
    ra*.*

    4. These are the prefixes used by individual ReportBuilder units. 'pp' is
    used for ReportBuilder units, 'da' is used for DADE units, and 'ra' is used
    for RAP units. Depending on which ReportBuilder you have (Standard,
    Professional or Enterprise) you may not have all of these unit types.



    Additional Notes

    1. Never have Delphi running when installing ReportBuilder.

    2. All ReportBuilder related files should be stored in the root directory
    $(DELPHI)\RBuilder.

    3. All ReportBuilder run-time packages should be stored in the
    Windows\System directory.

    4. You should never have ReportBuilder files in Delphi\Lib, Delphi\Bin or
    Delphi\Projects\Bpl.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2004
    Not quite. It turns out that it has something to do with using templates.

    It looks as if when saving the report to a template (database) it either
    does not save the parameters or perhaps it clears them when it loads the
    report back from the template.

    I am currently trying to work out how to get arount the problem.

    Peter


  • edited October 2004
    It also turns out that I am finally able to save the parameters by turning
    the 'Save as Template' option off, then saving the report then turning the
    option back on.

    However when I pass a value to the parametes it does seem to not work. I
    used a couple of string parameters but they show up as empty when previewing
    the report (at runtime and even design time since I am unable to save a
    default value into the template).

    I did reinstall Report Builder btw, but the problem is still the same.


  • edited October 2004
    Hi Peter,

    Does this only happen when saving to database? Could you please provide the
    exact steps you take to recreate this behavior?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2004
    Yes, it seems to only happen when saving to database.

    The steps to recreate the problem:

    a) create a report that is saved to database as a template - so far
    everything works.
    b) add a parameter and save the report - parameter seems to be saved - it is
    also shown in the form's private area.
    c) open the report designer. watch the designer delete and recreate the
    form's private area as it is opening
    d) check the form's private area and now the parameter is missing (also,
    shouldn't it be showing in the Objects list of the report when it opens? -
    anyway, it is not showing)
    c) close the report designer and check the parameters - the parameter is
    gone.

    I worked out that if I turn the 'Save as Template' option off and add the
    parameter first, then save the report and only then turn the 'Save as
    Template' option back on the parameter does get saved. However there is
    still something wrong a) it is not showing in the report designer (not sure
    if it should) b) passing values to the report via the parameter does not
    seem to work - I created a string parameter and tried to display it on the
    report but it always comes up blank. Even when I set a default value for
    the parameter. In fact the default value gets erased once I open the report
    in Report designer.

    The database is MS SQL 2000 and I am using Win XP.

    Peter

    Peter


  • edited November 2004
    Hi Peter,

    Unfortunately I am still unable to recreate this behavior. I have followed
    your steps exactly as you state them below. Is there something I'm missing
    in between steps c and d. The parameters are not missing when I preform
    these steps.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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

    These steps seem to reproduce the problem on my side every time.

    One thing I am not sure of, should the parameter show up in the object list
    when I open the report designer?
    If it should then I have a problem with the designer, since even the project
    you posted here a while ago (HideDetailWithParameters.zip) does not show the
    parameter in the list. Although after compiling the project works, but this
    project does not use the save as a template option.

    One thing worth mentioning - to install RB I compile the source and then
    install the bpl files in Delphi. Could it be that something is not right
    there? Do I have an old source file somewhere perhaps?

  • edited November 2004
    Hi Peter,

    I'm at a loss...

    Here are the exact steps I took in more detail. Perhaps you can spot
    something I'm doing that differs from your method.

    1. Place a TTable, TDataSource, DBPipeline, Report and a Button on an empty
    form and make the proper connections.
    2. Assign the proper values to the Report.Template.DataBaseSettings
    property.
    3. Open the Parameters Editor and add one parameter.
    4. Add a Report.Template.SaveToDatabase call to the Button.Click event.
    5. Run the application and save the report to the database.

    6. Add a Designer and another button to the form and connected it to the
    Report.
    7. Remove all parameters from the Report.
    8 Add a Report.Template.LoadFromDataBase and Designer.ShowModal call to
    the new Button.Click event.
    9. Load the report and test the Parameter in the designer.
    10. Save the report to file.
    11. Load the report template into another report object and check that the
    parameters are present.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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