Board index » delphi » Crystal Reports 8.0 engine jobs/preview limit?

Crystal Reports 8.0 engine jobs/preview limit?

Hi,

I am curently working on a piece of code that produces a lot of reports in
sequence in an automated fashion.  Doing this, I have discovered that the
crystal reporting engine has a limit of 19 (???) concurrent print jobs.
Further, once you've tried to push it beyond that, the dll seems to go pop
and I can't do any more processing (previews or printing) until I get the
dll fully unloaded or restart the application.

This is most annoying as it is very difficult to explain to users why they
can only open up 19 previews at one time.  For fully automated printing (no
previews) I've gotten around the problem by 'CloseEngine' ing after every
job, to force the engine to reload, but this does not seem very efficient to
me.

Any suggestion as to how one can get around this?  (Or am I being stupid and
is this due to some other problem?)

Other info:

NT4.0 SP5
Delphi5 Pro SP1
Crystal 8.0 VCL 5, version 2 (updated) engine 8.0.0.371

--
- There is no security on this Earth, there is only opportunity. General
Douglas MacArthur 1880-1964, American Army General in WW II
- People are always blaming their circumstances for what they are. I don't
believe in  circumstances. The people who get on in the world are the people
who get up and look for the circumstances they want and if they can't find
them, make them. - George Bernard Shaw, 1856-1950, Irish-born British
Dramatist

 

Re:Crystal Reports 8.0 engine jobs/preview limit?


Walter,

I hadn't come across this one, but I have successfully run crpe32.dll in
a number of separate threads.  Could this be a possibility?

John Pierce

Re:Crystal Reports 8.0 engine jobs/preview limit?


Quote
"Walter Prins" <wpr...@ananzi.co.za> wrote...
> Crystal 8.0 VCL 5, version 2 (updated) engine 8.0.0.371

I have not run into this either, but I would recommend looking at the
newer VCL.  If I read this correctly, you're using version 7.52 of the
VCL component, version 8 is out and fixed a number of "overhead" issues
for me.

http://users.uniserve.ca/~zimmerman/delphi.htm has download
instructions.  If you still have problems, contact Frank Zimmerman (VCL
developer) directly and he may fix the VCL.

-Brion

Re:Crystal Reports 8.0 engine jobs/preview limit?


Quote
> "Walter Prins" <wpr...@ananzi.co.za> wrote...
> > Crystal 8.0 VCL 5, version 2 (updated) engine 8.0.0.371

> I have not run into this either, but I would recommend looking at the
> newer VCL.  If I read this correctly, you're using version 7.52 of the
> VCL component, version 8 is out and fixed a number of "overhead" issues
> for me.

Hi,

Firstly, I made a slight error -- the limit is 20 jobs -- I miscounted last
time I checked.

Responding to your post:  Are you refering to the beta VCL that is
available?  The version of VCL that I'm using is as far as I can tell the
latest officially supported release from Crystal Decisions.  It was
extracted from the file 7VCL51, so if this means its actually the version 7
VCL, then where do I get the version 8 file?  (Is it on the website? If so
where -- I did not see such a beast under the updates/support part of the
site.)  If you are referring to the Beta, is it stable enough for to risk
trying, bearing in mind I want to write production quality code?

Lastly, I can comment that I don't believe this is per se a VCL issue, but
possibly rather a Crystal reporting engine issue.  (Anyone knowing better
please correct me!)

In any case,  to demonstrate the problem, do the following:
1) Create a delphi new project
2) On the main form, drop a button
3) Create a click handler for the button (TForm1.Button1Click) using the
Object Inspector.
4) Replace that empty handler with the code below:
5) Save the project in a suitable location
6) Create a stock standard blank report with nothing on it, and save this
with the project, calling it 'blank.rpt'
7) Run the project. You will be warned on the 21st attempt, which will fail.

Any ideas most appreciated.

----------------------------------------------------------------------------
-----------------------8<-----------------------------------------

uses UCrpe32;

procedure TForm1.Button1Click(Sender: TObject);
  procedure Check(b : Boolean);
  begin if not b then raise Exception.Create('A Crpe call failed.'); end;
var
  ACrpe : TCrpe;
  ACrpeList : TList;
  i : Integer;
begin
  ACrpeList := TList.Create;
  try
     for i := 1 to 21 do
     begin
        if i = 21 then MessageDlg('The following report attempt will fail:',
mtInformation, [mbOK], 0); // this line warns just prior to failure

        ACrpe := TCrpe.Create(nil);
        ACrpeList.Add(ACrpe);

        with ACrpe do
        begin
           ReportName := 'blank.rpt';
           Output := toWindow;
           //Check(VerifyDatabase);    //Unless we actually have a link to a
DB in the .rpt we can't have this
           Check(DiscardData);
           Check(Execute);
           repeat Application.ProcessMessages until Status = 3
        end;
     end;
  finally
     for i := 0 to ACrpeList.Count-1 do
        TCrpe(ACrpeList[i]).Free;
     ACrpeList.Free;
  end;
end;

Re:Crystal Reports 8.0 engine jobs/preview limit?


Quote
"Walter Prins" <wpr...@ananzi.co.za> wrote...
> Responding to your post:  Are you refering to the beta VCL that is
> available?  The version of VCL that I'm using is as far as I can tell
the
> latest officially supported release from Crystal Decisions.  It was
> extracted from the file 7VCL51, so if this means its actually the
version 7
> VCL, then where do I get the version 8 file?  (Is it on the website?
If so
> where -- I did not see such a beast under the updates/support part of
the
> site.)  If you are referring to the Beta, is it stable enough for to
risk
> trying, bearing in mind I want to write production quality code?

The beta is actually completed, the version available from zimmerman's
web site is the final submitted to Crystal Decisions.  It's in their ftp
site somewhere, but hasn't been pushed out to their "files and updates"
section.  Probably taking longer what with the name change and
everything, but then again we're (Delphi users) second priority for
everything Crystal.

I'll test your case tomorrow, I'm out of time today.

-Brion

Re:Crystal Reports 8.0 engine jobs/preview limit?


Quote
"Walter Prins" <wpr...@ananzi.co.za> wrote...
> Lastly, I can comment that I don't believe this is per se a VCL issue,
but
> possibly rather a Crystal reporting engine issue.  (Anyone knowing
better
> please correct me!)

> In any case,  to demonstrate the problem, do the following:
> 1) Create a delphi new project
> 2) On the main form, drop a button
> 3) Create a click handler for the button (TForm1.Button1Click) using
the
> Object Inspector.
> 4) Replace that empty handler with the code below:
> 5) Save the project in a suitable location
> 6) Create a stock standard blank report with nothing on it, and save
this
> with the project, calling it 'blank.rpt'
> 7) Run the project. You will be warned on the 21st attempt, which will
fail.

Executing your code, I do indeed fail, with a PE error message:

Error: 544 Error in File UNKNOWN
Cannot Access Report
OpenPrintJob <PEOpenPrintJob>.

However, drop a TCrpe component on the form and a second button.  Add
the following event handler:

procedure TForm1.Button2Click(Sender: TObject);
var
  loop: integer;
begin
  Crpe1.ReportName := 'blank.rpt';
  Crpe1.Output := toWindow;
  for loop := 1 to 30 do
    Crpe1.Execute;
end;

All 30 reports show up for me.  Any particular reason to create the crpe
object at run-time?

-Brion

Re:Crystal Reports 8.0 engine jobs/preview limit?


Hi,

Thanks for the reply.  There is no real reason for me dynamically
instantiating the component -- other than the fact that I didn't see any
need to do it otherwise at the time. (Everything gets set in code during
processing, and so I thought I might as well keep it consistent and
instantiate a TCrpe to do my bidding as well, rather than dropping a forlorn
component on a form...  )

I'll definitely try your suggestion. Thanks again for the help.  (And I'll
try the new vcl as well -- it would appear that this is indeed a vcl
issue...)

Kind Regards,

Walter Prins

Re:Crystal Reports 8.0 engine jobs/preview limit?


Hi

I have in the meantime done some more testing, and the solution below is a
non starter -- it does not change the report or any parameters.  The key to
my dilemma is that I am running potentially different report files.  To
illustrate, I've modified your code sligthly. Its listed below your
original.

Quote
> However, drop a TCrpe component on the form and a second button.  Add
> the following event handler:

> procedure TForm1.Button2Click(Sender: TObject);
> var
>   loop: integer;
> begin
>   Crpe1.ReportName := 'blank.rpt';
>   Crpe1.Output := toWindow;
>   for loop := 1 to 30 do
>     Crpe1.Execute;
> end;

> All 30 reports show up for me.  Any particular reason to create the crpe
> object at run-time?

Here is a slight modification of your code, that fakes a report file change.
(Note this does not use any dynamic instantiation.)

procedure TForm1.Button2Click(Sender: TObject);
var
  loop: integer;
begin
  Crpe1.Output := toWindow;
  for loop := 1 to 30 do
  begin
    Crpe1.ReportName := '';
    Crpe1.ReportName := 'blank.rpt';
    Crpe1.Execute;
  end;
end;

Running this produces exactly the same error after 20 jobs as before.  I'm
again begining to suspect the reporting engine here...  which means I'm back
where I started.

Also, regarding the dynamic instantiation in my original -- there was a
reason for this -- I have a customized preview window, and so each window
has to have its own crpe to drive it -- if you don't then all the buttons
etc on all the windows control the last ran report's window (since they all
share one crpe component), if you see what I'm saying.

Regards,

Walter

Re:Crystal Reports 8.0 engine jobs/preview limit?


Quote
"Walter Prins" <wpr...@ananzi.co.za> wrote...
> Hi

> I have in the meantime done some more testing, and the solution below
is a
> non starter -- it does not change the report or any parameters.  The
key to
> my dilemma is that I am running potentially different report files.
To
> illustrate, I've modified your code sligthly. Its listed below your
> original.

If I'd been thinking, I would have reset the report name myself.  D'oh!
I'd suggest logging a bug with Crystal Decisions.  In my experience,
every bug I've reported has been answered with:

<slightly paraphrased>
"You're right!  There's a bug there, imagine that.  Well, we'll be sure
to ignore it as soon as possible, if you're lucky we'll fix it in the
next version, but we won't tell you about it either way.  In the
meantime, I'm just going to close this call, because there's no
workaround.  That way the developers won't know about it either.  Have a
nice day!"

Good luck!
-Brion

Re:Crystal Reports 8.0 engine jobs/preview limit?


Thanks for the input,

At least now I'm fairly sure it's not me being stupid about something.  I'll
report it and see what happens.  (Sorry for only replying now -- I've been
away on holiday the past week.)

Regards,

Walter Prins

Other Threads