BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Impossible?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
Barry Maslyk
Guest





PostPosted: Fri Sep 09, 2005 4:56 pm    Post subject: Impossible? Reply with quote



Hi

I was told that it is impossible to add an existing crystal report to a
VCL forms app for win 32 in Delphi 2005. Can someone confirm or deny this?

Here is the situation. I am brand new to delphi 2005 (but have been using
delphi 6 for a while) but am upgrading a delphi 6 app which had crystal
reports. So far I have been able to migrate it to VCL forms app for win 32
but unable to do so in .NET. In VCL I can not get the crystal report viewer
in either design or code view. In code view, I can get a crystal report
component but when I click on it it goes through the expert and then seems
to disappear. Am I doing something wrong?

Also when I read all the documentation it does not specify VCL or .Net
but it does specify that you need the crystal report viewer. Is there a
trick make the crystal component visible in a VCL app?

I find this strange as in delphi 6 there was a crystal VCLl component.

Any help would be greatly appreciated.


Back to top
Brion L. Webster
Guest





PostPosted: Fri Sep 09, 2005 9:42 pm    Post subject: Re: Impossible? Reply with quote



Barry Maslyk wrote:

Quote:
I was told that it is impossible to add an existing crystal report to a VCL forms app for win 32 in Delphi 2005. Can someone confirm or deny this?

Here is the situation. I am brand new to delphi 2005 (but have been using
delphi 6 for a while) but am upgrading a delphi 6 app which had crystal
reports. So far I have been able to migrate it to VCL forms app for win 32
but unable to do so in .NET. In VCL I can not get the crystal report
viewer in either design or code view. In code view, I can get a crystal
report component but when I click on it it goes through the expert and
then seems to disappear. Am I doing something wrong?

Also when I read all the documentation it does not specify VCL or .Net but
it does specify that you need the crystal report viewer. Is there a trick
make the crystal component visible in a VCL app?

I find this strange as in delphi 6 there was a crystal VCLl component.

Any help would be greatly appreciated.

Right around Delphi 6 the enforcement of design time separation
(DesignIntf stuff) changed drastically for components. As a result, older
versions of the Crystal VCL wouldn't work. If you have the Crystal VCL
from Crystal Reports 8 or 8.5, you should be fine.

Here's how I added Win32 VCL support for Crystal Reports to Delphi 2005.

Unpack raw version 8 VCL (supports Delphi 6)

Rename ?cl6cr85.dpk to ?cl9cr85.dpk and ?cl6cr85.res to ?cl9cr85.res.
Edit ?cl9cr85.dpk with notepad to change internal name to 10.
Edit UcrpeDef.inc with notepad, add

{ Delphi 6+ }
{$IFDEF CONDITIONAL_EXPRESSIONS}
{$DEFINE CR_DELPHI6}
{$DEFINE CR_ALL6}
{$DEFINE CR_6UP}
{$DEFINE CR_5UP}
{$DEFINE CR_4UP}
{$DEFINE CR_3UP}
{$DEFINE CR_2UP}
{$DEFINE CR_D6UP}
{$DEFINE CR_D5UP}
{$DEFINE CR_D4UP}
{$DEFINE CR_D3UP}
{$DEFINE CR_D2UP}
{$DEFINE CR_D6DOWN}
{$ENDIF CONDITIONAL_EXPRESSIONS}

at top of Conditional Defines

For me, it then compiles & installs fine. Note that
"Conditional_Expressions" is only defined for Delphi 6 and higher. To
further future-proof your code, you could add a second check:

{$IFDEF CONDITIONAL_EXPRESSIONS}
{$IF COMPILERVERSION >=14.0}
do stuff
{$IF END}
{$IF COMPILERVERSION >=19.0}
do different stuff
{$IF END}
{$ENDIF CONDITIONAL_EXPRESSIONS}

The >= check allows you to stop changing package source for every new
version of Delphi. You can stop adding checks for each new compiler
version, as 150 is greater than 140, 160 is greater than 140, etc., but
that inner loop will always be true.

That should get you Win32 Crystal development in Delphi 2005. For .NET
Crystal Development, my understanding is Delphi 2005 ships with the C#
Builder package for Crystal Reports for .NET development. That was only
supported in the C# Builder personality. Not sure if C# Builder supports
VCL.NET development at all. I haven't done a lick of .NET or VCL.NET
testing with Crystal.

-Brion

Back to top
Barry Maslyk
Guest





PostPosted: Wed Sep 14, 2005 11:06 pm    Post subject: Re: Impossible? Reply with quote



Hi

Thank you for the help. I have had a bit of a problem though.

When I edited dcl9cr85.dpk with note pad I do not see an internal name I
change the package name to dcl9cr85. Or are you refering to the description
or something else? I add the changes to UcrpeDef.inc. But only the first
version of the conditional defines (not the future proof code).

When I compile dcl9cr85.dpk I get and error at the TYPE keyword. The
error is

[Error] UCrpeReg.pas(17): E2029 Identifier expected but 'TYPE' found

The following is the beginning of the file listing:

(*
UCRPEREG.PAS
Crystal Reports VCL Component - Registration Unit & Design Dialogs
Copyright(c) 2001 Crystal Decisions
*)
unit UCrpeReg;

{$I UCRPEDEF.INC}

interface

uses
Classes,
{$IFDEF CR_6UP}DesignIntf, DesignEditors;{$ENDIF CR_6UP}
{$IFDEF CR_D5DOWN}DsgnIntf;{$ENDIF CR_D5DOWN}

type
// point where the error occurs


Can you tell me what I am doing wrong?

Barry


"Brion L. Webster" <brion.webster (AT) nospam (DOT) ci.fresno.ca.us> wrote

Quote:
Barry Maslyk wrote:

I was told that it is impossible to add an existing crystal report to a
VCL forms app for win 32 in Delphi 2005. Can someone confirm or deny
this?

Here is the situation. I am brand new to delphi 2005 (but have been using
delphi 6 for a while) but am upgrading a delphi 6 app which had crystal
reports. So far I have been able to migrate it to VCL forms app for win 32
but unable to do so in .NET. In VCL I can not get the crystal report
viewer in either design or code view. In code view, I can get a crystal
report component but when I click on it it goes through the expert and
then seems to disappear. Am I doing something wrong?

Also when I read all the documentation it does not specify VCL or .Net but
it does specify that you need the crystal report viewer. Is there a trick
make the crystal component visible in a VCL app?

I find this strange as in delphi 6 there was a crystal VCLl component.

Any help would be greatly appreciated.

Right around Delphi 6 the enforcement of design time separation
(DesignIntf stuff) changed drastically for components. As a result, older
versions of the Crystal VCL wouldn't work. If you have the Crystal VCL
from Crystal Reports 8 or 8.5, you should be fine.

Here's how I added Win32 VCL support for Crystal Reports to Delphi 2005.

Unpack raw version 8 VCL (supports Delphi 6)

Rename ?cl6cr85.dpk to ?cl9cr85.dpk and ?cl6cr85.res to ?cl9cr85.res.
Edit ?cl9cr85.dpk with notepad to change internal name to 10.
Edit UcrpeDef.inc with notepad, add

{ Delphi 6+ }
{$IFDEF CONDITIONAL_EXPRESSIONS}
{$DEFINE CR_DELPHI6}
{$DEFINE CR_ALL6}
{$DEFINE CR_6UP}
{$DEFINE CR_5UP}
{$DEFINE CR_4UP}
{$DEFINE CR_3UP}
{$DEFINE CR_2UP}
{$DEFINE CR_D6UP}
{$DEFINE CR_D5UP}
{$DEFINE CR_D4UP}
{$DEFINE CR_D3UP}
{$DEFINE CR_D2UP}
{$DEFINE CR_D6DOWN}
{$ENDIF CONDITIONAL_EXPRESSIONS}

at top of Conditional Defines

For me, it then compiles & installs fine. Note that
"Conditional_Expressions" is only defined for Delphi 6 and higher. To
further future-proof your code, you could add a second check:

{$IFDEF CONDITIONAL_EXPRESSIONS}
{$IF COMPILERVERSION >=14.0}
do stuff
{$IF END}
{$IF COMPILERVERSION >=19.0}
do different stuff
{$IF END}
{$ENDIF CONDITIONAL_EXPRESSIONS}

The >= check allows you to stop changing package source for every new
version of Delphi. You can stop adding checks for each new compiler
version, as 150 is greater than 140, 160 is greater than 140, etc., but
that inner loop will always be true.

That should get you Win32 Crystal development in Delphi 2005. For .NET
Crystal Development, my understanding is Delphi 2005 ships with the C#
Builder package for Crystal Reports for .NET development. That was only
supported in the C# Builder personality. Not sure if C# Builder supports
VCL.NET development at all. I haven't done a lick of .NET or VCL.NET
testing with Crystal.

-Brion



Back to top
Brion L. Webster
Guest





PostPosted: Mon Sep 19, 2005 8:33 pm    Post subject: Re: Impossible? Reply with quote

Barry Maslyk wrote:

Quote:
Thank you for the help. I have had a bit of a problem though.

When I edited dcl9cr85.dpk with note pad I do not see an internal name I
change the package name to dcl9cr85. Or are you refering to the
description or something else? I add the changes to UcrpeDef.inc. But only
the first version of the conditional defines (not the future proof code).

The very beginning of each dpk (there are two, vcl* and dcl*) should start
with the package declaration and the package name:

package dcl9cr85;

{$R *.res}
{$R 'UCrpeReg.dcr'}
{$ALIGN 1}
....

Quote:
When I compile dcl9cr85.dpk I get and error at the TYPE keyword. The error is

[Error] UCrpeReg.pas(17): E2029 Identifier expected but 'TYPE' found

That tells me neither CR_D6UP nor CR_D5Down are defined. Neither of the
lines after "Classes" in the Uses clause are being executed.

Quote:
Edit UcrpeDef.inc with notepad, add

{ Delphi 6+ }
{$IFDEF CONDITIONAL_EXPRESSIONS}
{$DEFINE CR_DELPHI6}
{$DEFINE CR_ALL6}
{$DEFINE CR_6UP}
{$DEFINE CR_5UP}
{$DEFINE CR_4UP}
{$DEFINE CR_3UP}
{$DEFINE CR_2UP}
{$DEFINE CR_D6UP}
{$DEFINE CR_D5UP}
{$DEFINE CR_D4UP}
{$DEFINE CR_D3UP}
{$DEFINE CR_D2UP}
{$DEFINE CR_D6DOWN}
{$ENDIF CONDITIONAL_EXPRESSIONS}


I appear to have made a typo - per the Delphi 7 help, that should be
CONDITIONALEXPRESSIONS without the underscore "_" character.

-Brion

Back to top
Barry Maslyk
Guest





PostPosted: Fri Sep 23, 2005 11:09 pm    Post subject: Re: Impossible? Reply with quote

Thank you once again. But I have still come up with a problem and an
observation.

The observation is that the package will not load correctly unless I
dcl6cr85.res, which I renamed to dcl9cr85.res, to dcl10cr85.res. Is this
what should be happening?

In any event when the packages does load and I press the compile button
it gives an error saying that can not run without associated to a host
application. I close all then start a new win 32 application. Then I add to
project and go to the directory where the VCL is stored. At this point I
don't have the option to choose *.dpk so I add all the *.pas. When I do that
and then compile I get the following error

[Fatal Error] Project1.dpr(100): F1026 File not found: 'DesignIntf.dcu'

If I fake it by putting in a blank file or remove the declaration I get the
following error:

[Fatal Error] UCrpeReg.pas(14): F1026 File not found: 'DesignEditors.dcu'

If I fake this one by putting in a blank form or remove the declaration I
get many, many errors.

Do you have any suggestions?

Barry

"Brion L. Webster" <brion.webster (AT) nospam (DOT) ci.fresno.ca.us> wrote

Quote:
Barry Maslyk wrote:

Thank you for the help. I have had a bit of a problem though.

When I edited dcl9cr85.dpk with note pad I do not see an internal name I
change the package name to dcl9cr85. Or are you refering to the
description or something else? I add the changes to UcrpeDef.inc. But only
the first version of the conditional defines (not the future proof code).

The very beginning of each dpk (there are two, vcl* and dcl*) should start
with the package declaration and the package name:

package dcl9cr85;

{$R *.res}
{$R 'UCrpeReg.dcr'}
{$ALIGN 1}
...

When I compile dcl9cr85.dpk I get and error at the TYPE keyword. The
error is

[Error] UCrpeReg.pas(17): E2029 Identifier expected but 'TYPE' found

That tells me neither CR_D6UP nor CR_D5Down are defined. Neither of the
lines after "Classes" in the Uses clause are being executed.

Edit UcrpeDef.inc with notepad, add

{ Delphi 6+ }
{$IFDEF CONDITIONAL_EXPRESSIONS}
{$DEFINE CR_DELPHI6}
{$DEFINE CR_ALL6}
{$DEFINE CR_6UP}
{$DEFINE CR_5UP}
{$DEFINE CR_4UP}
{$DEFINE CR_3UP}
{$DEFINE CR_2UP}
{$DEFINE CR_D6UP}
{$DEFINE CR_D5UP}
{$DEFINE CR_D4UP}
{$DEFINE CR_D3UP}
{$DEFINE CR_D2UP}
{$DEFINE CR_D6DOWN}
{$ENDIF CONDITIONAL_EXPRESSIONS}


I appear to have made a typo - per the Delphi 7 help, that should be
CONDITIONALEXPRESSIONS without the underscore "_" character.

-Brion



Back to top
Brion L. Webster
Guest





PostPosted: Mon Sep 26, 2005 7:23 pm    Post subject: Re: Impossible? Reply with quote

Barry Maslyk wrote:

Quote:
The observation is that the package will not load correctly unless I
dcl6cr85.res, which I renamed to dcl9cr85.res, to dcl10cr85.res. Is this
what should be happening?

No, this should not be happening - what this likely means is you've
renamed the dpk file to dcl10cr85.dpk. The "package dcl9cr85; {$R *.res}"
part tells Delphi to pull in the .res file with the same name as the .dpk
file.

Quote:
In any event when the packages does load and I press the compile button it
gives an error saying that can not run without associated to a host
application. I close all then start a new win 32 application. Then I add
to project and go to the directory where the VCL is stored. At this point
I don't have the option to choose *.dpk so I add all the *.pas. When I do
that and then compile I get the following error

I would try these steps:

1) Start Delphi 2005.
2) File -> Close All
3) File -> Open
Navigate *first* to vcl9cr85.dpk and select it
4) Project -> Compile
It should compile smoothly, perhaps with "platform specific" warnings
5) File -> Open
Navigate to dcl9cr85.dpk and select it
6) Project -> Compile
It should compile smoothly, perhaps with "platform specific" warnings
7) View -> Project Manager (might already be visible)
Cool Right-click on the bpl and select Install (don't know where the menu
item is)
You should get the two new components registered.

If that still fails, try sending me your source and I'll see if I can't
fix it up. Remove the nospam part.

-Brion

Back to top
Barry Maslyk
Guest





PostPosted: Mon Sep 26, 2005 9:16 pm    Post subject: Re: Impossible? Reply with quote

Hi

Thank you this worked. I actually had to remove the path from the
tools->option->library - win32 that I was instructed to put in by the
Crystal readme.txt file before it worked.

Once again thank you for your patience and time.

Barry


Back to top
Brion L. Webster
Guest





PostPosted: Tue Sep 27, 2005 10:15 pm    Post subject: Re: Impossible? Reply with quote

Barry Maslyk wrote:

Quote:
Hi

Thank you this worked. I actually had to remove the path from the
tools->option->library - win32 that I was instructed to put in by the
Crystal readme.txt file before it worked.

Once again thank you for your patience and time.

Barry

Hey - *I* never told you to put in a path, now did I? Who are you going
to trust, me or those darn Crystal folks? ;-)

Glad it worked out.

--

Brion

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.