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

ppRichText components behavior

edited July 2004 in General
Hi,

Im using Delphi 7, ReportBuilder 7.03, Pragnaan export devices v 2.04 in an
IntraWeb application on Windows 2000

I compile the application either as a stand-alone of as an Apache DSO (see:
www.nols.dns4me.com/geoinfo )

Problem when using it in a stand-alone executeable:

The first time when I run the report it works fine. But the next time when
I run the report the ppRichText component refuses to accept text in the
BeforePrint event (but a ppMemo componet do not have this problem) with a
typical statement such as:
ppRichTextAuthor.Richtext := CDSMatchesC_AUTHOR.AsString;

Problem when using it as an Apache DSO:

It seems after a few runs of the report, I get a type of a time-out. The
application hangs. The file size of the Rtf file created on the server is
zero bytes. This file stay in-use till I stop and restart Apache. It seems
the problem is releated to the problem when using it in a stand-alone
executeable because the ppRichText fields are empty after I stopped and
restarted Apache.

In the code shown below: Must I use the ppReport1.Reset; command to
pre-initialized the report (as if it was not used before) ?


Regards,

Nols Smit


My code to activate the report in the IntraWeb application and pop it out in
a new browser window:

procedure TfrmReport.btnRunClick(Sender: TObject);
const
AIPOptions: string =
'toolbar=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,location=no,d
irectories=no,width=780,height=580';
AIPNewWindow: string = 'NewWindow("%s", "%s", "%s");'; { A mask for the
Format }
var
sFileName, sFilePathName, AIPURL: string;
i: integer;
F: boolean;


procedure CheckForFile;
begin
i := 0;
F := true;

while not FileExists(sFilePathName) do
begin
Sleep(2000);
inc(i);
if i > 10 then
begin
WebApplication.ShowMessage('problems to create file, contact
Webmaster');
F := false;
break;
end;
end;

end;

begin
Case rgShowAbstracts.ItemIndex of
0: UserSession.ShowAbstracts := true;
1: UserSession.ShowAbstracts := false;
end;
with DataModule1 do
begin
Case rgOutput.ItemIndex of
0:
begin
sFileName := WebApplication.AppID + '_' +
IntToStr(Random(1000)) + '.rtf';
sFilePathName := gsAppPath + '\Files\' + sFileName;
end;
1:
begin
sFileName := WebApplication.AppID + '.htm';
sFilePathName := gsAppPath + '\Files\' + sFileName;
PsRBExportMasterControl1.HTML.SeparateFilePerPage := false;
end;
end;

case rgOutput.ItemIndex of
0: ExportToRTF(ppReport1, sFilePathName);
1: ExportToHTML(ppReport1, sFilePathName);
end;

case rgOutput.ItemIndex of
0: AIPURL := WebApplication.AppURLBase + '/Files/' + sFileName;
else AIPURL := WebApplication.AppURLBase + '/FilesNC/' + sFileName;
end;

CheckForFile;
if F then
AddToInitProc('NewWindow("' + AIPURL + '", "Agenda", "' + AIPOptions
+'");');

ppReport1.Reset;
end;
end;

Comments

  • edited July 2004
    Hi Nols,

    1. Try placing a breakpoint inside the Report.BeforePrint event to be sure
    the code is firing correctly the second time you load it. If it isn't, you
    may need to use a different event or simply fill the rich text before
    calling report.print.

    2. There are no known issues of this type that we are aware of. If you are
    creating a type of web report server, you may want to check out the
    ReportBuilder Server Edition. The Server Edition allows you to create a web
    tier application using Apache.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2004
    Dear Nick,

    Following is my code where I fill the ppRichText component. I have set a
    breakpoint and in the the second run I can see how the ppRichText component
    refuses to accept any text string.

    procedure TDataModule1.ppDetailBand1BeforePrint(Sender: TObject);
    var
    i, ThisID: integer;
    AText: string;

    begin
    ThisID := CDSMatchesRelativeID.AsInteger;
    if UserSession.MarkedArray.FindItem(i,ThisID) then
    begin
    ppDetailBand1.Visible := true;

    ppMemoNrs.Lines.Add(IntToStr(CDSMatchesUQ_SAGEOLIT_NO.AsVariant));

    ppRichTextAuthor.Richtext := CDSMatchesC_AUTHOR.AsString;
    if ppRichTextAuthor.Richtext <> '' then
    MarkWordsRTFReport(ppRichTextAuthor, clred, [fsBold,fsUnderline],
    UserSession.WordList);

    etc.


    Regards,

    Nols Smit
  • edited July 2004
    Hi Nols,

    I'm unclear what you mean by "Second Run". Are you completely closing your
    application down and reloading it, or are you just closing down the report
    and re-loading that? In my testing whis similar code to your code below, I
    was able to do both and still add text to the TppRichText.RichText property
    successfully.



    --
    Best Regards,

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

    Thanks for the patience with me.

    By second run I mean you re-run the report without restarting the
    application.

    If you have a look at the live application at www.nols.dns4me.com/geoinfo

    Use a search term like diamond
    Click on the Search button.
    Click on the mark button.
    Click on the "Mark for print" button.
    Click on the "Click for Menu button" and choose Run Report.
    Click on the "Run report" button

    Now my problem: I may re-run the same report several times (the application
    compiled as an Apache DSO) without problems but suddenly it will hang
    (freeze) and on the server the file will stay in-use (file size zero bytes)
    till I restart Apache.

    With the application compiled as a stand-alone IntraWeb application, I
    traced it by setting a break-point and in the second (subsequent) run I can
    see how the ppRichText components refuses to accept any text string while
    the memo component has no problem.
    I use the ppMemo component for the number and ppRichText components for the
    other fields because I do highlighting of the search words in the ppRichText
    fields.



    Regards,

    Nols Smit

  • edited July 2004
    Hi Nols,

    Thanks for the explaination. I have never seen this bahavior in
    ReportBuilder before. If possible please create a simple stand alone
    example that demonstrates this behavior (ppRichText refusing text string)
    and send it in .zip format to support@digital-metaphors.com so we can
    research this further.

    --
    Best Regards,

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