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

Showing Preview in Designer.

edited April 2007 in General
Hi

We are trying to show the preview page in the designer window and deny
access to the designer page itself for low level users by hiding the TabSet
and changing the ActivePage of the Notebook page control.

This is not working, the Preview page contains nothing, not even a blank
report. Something that gets fired off between tabs obviously isn't firing.
What do I need to do, or rather what am I doing wrong? Is there a better
way of doing this?

Comments

  • edited April 2007
    rather then the designer, why not just show a viewer? Make the decision when
    creating the object.

    --
    Ed Dressel
    Team DM
  • edited April 2007
    For the lower end users I can do just that, but for the upper end users I
    still want to show the designer displaying the preview page first. Is this
    possible?
  • edited April 2007
    Hi Martin,

    In my testing with the following code in the OnShow event of the
    TppDesigner, the designer opened with the preview tab selected successfully.

    procedure TForm1.ppDesigner1Show(Sender: TObject);
    begin
    ppDesigner1.Notebook.ActivePage := ppDesigner1.Notebook.Pages[1];
    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    This does indeed switch to the Preview tab, but the preview page contains
    nothing, not even a blank report. I need to click the Design tab and then
    the Preveiw tab to get it to show the preview. Something that gets fired
    off between tabs isn't firing.
  • edited April 2007
    Which version of ReportBuilder are you using? In my testing with RB 10.06
    for Delphi 2007, the report is generated and displayed properly in the
    preview tab using the exact code I gave in my previous post.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    We're using ReportBuilder 9.03 with Delphi 6.
  • edited May 2007
    Hi Martin,

    I'm sorry, I do not have older versions of ReportBuilder available to test
    with and this is not a known issue with RB 9.03. You might try taking a
    look at the 9.03 source to see the order of opperations before the tab is
    changed to Preview and perhaps mimic that in your own code when you change
    the tab manually. Or consider upgrading to RB 10.06 for Delphi 6.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2007
    Hi
    Found a solution. Copied ppDsgner.pas, renamed unit and TppDesiignerWindow,
    moved the SetPageActive procedure from Private to Public and used
    ppRegisterForm. I was then able to modify your OnShow solution as follows:

    with MyDesigner, NoteBook do
    begin
    Allow := True;
    TppDesignerWindow(Form).SetPageActive(ActivePage, False, Allow);
    ActivePage := FindNextPage(ActivePage,True,False);
    TppDesignerWindow(Form).SetPageActive(ActivePage, True, Allow);

    end;

    However, I do have a fresh problem now in that when I add raIDE to the uses
    clause to show the Calc tab it wont compile stating "Unit raClcDlg was
    compiled with a different version of ppDsgner.TppDesignerWindow". Any
    suggestions how I can get past this last hurdle?
  • edited May 2007
    Hi Martin,

    Since we do not provide the source code to RAP, you cannot change the
    Interface sections of any of the ReportBuilder source files and still use
    the RAP functionality. You will either need to disable RAP or find another
    way to call the routines you need without changing the Interface section.
    Take a look in the source for public routine that calls SetPageActive that
    you could possibly use.

    --
    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.