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 

Opening a Crystal Report from Delphi

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





PostPosted: Wed Feb 16, 2005 3:24 pm    Post subject: Opening a Crystal Report from Delphi Reply with quote



I'm trying to export a report from Delphi5 using VCL7.5.0.51

However I have problems doing this when the report has got subreports! I
don't know if I need to pass the parameters to the subreports as well.(Hope
not)

Can someone please point me to any links or tell me what properties I'll
have to set.

Regards
Brian


Back to top
Brion L. Webster
Guest





PostPosted: Wed Feb 16, 2005 6:15 pm    Post subject: Re: Opening a Crystal Report from Delphi Reply with quote



Brian Ellul wrote:

Quote:
I'm trying to export a report from Delphi5 using VCL7.5.0.51

However I have problems doing this when the report has got
subreports! I don't know if I need to pass the parameters to the
subreports as well.(Hope not)

Can someone please point me to any links or tell me what
properties I'll have to set.

IIRC, you have to iterate the subreports collection and all tables
in each subreport and set them all. I don't have the version 7 VCL
hanging around any more to double-check the help file.

Subreports are evil.

-Brion

Back to top
Brian Ellul
Guest





PostPosted: Thu Feb 17, 2005 7:17 am    Post subject: Re: Opening a Crystal Report from Delphi Reply with quote



It's very strange that things complicated so much! Through Delphi2 all this
was transparent to the developer.

Regards
Brian

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

Quote:
Brian Ellul wrote:

I'm trying to export a report from Delphi5 using VCL7.5.0.51

However I have problems doing this when the report has got
subreports! I don't know if I need to pass the parameters to the
subreports as well.(Hope not)

Can someone please point me to any links or tell me what
properties I'll have to set.

IIRC, you have to iterate the subreports collection and all tables
in each subreport and set them all. I don't have the version 7 VCL
hanging around any more to double-check the help file.

Subreports are evil.

-Brion



Back to top
Tom Wedge
Guest





PostPosted: Thu Feb 17, 2005 11:55 am    Post subject: Re: Opening a Crystal Report from Delphi Reply with quote

Brian Ellul wrote:

Quote:
It's very strange that things complicated so much! Through Delphi2
all this was transparent to the developer.

Regards
Brian

"Brion L. Webster" <brion.webster (AT) nospam (DOT) ci.fresno.ca.us> wrote in
message news:42138dda (AT) newsgroups (DOT) borland.com...
Brian Ellul wrote:

I'm trying to export a report from Delphi5 using VCL7.5.0.51

However I have problems doing this when the report has got
subreports! I don't know if I need to pass the parameters to the
subreports as well.(Hope not)

Can someone please point me to any links or tell me what
properties I'll have to set.

IIRC, you have to iterate the subreports collection and all tables
in each subreport and set them all. I don't have the version 7 VCL
hanging around any more to double-check the help file.

Subreports are evil.

-Brion

Hi

We have never had to pass parameters down to the sub reports in Crystal
7 or 8. Before running the report we will cycle throught the parameters
and assign values to the ones where NEEDSCURRENTVALUE is True and the
report has allows worked with sub reports. The only thing you might
have truble with on a database engines like Sybase or MSSQL is that the
connection parameters are passed down to the sub reports which is done
by setting

Crpe1.Connect.Propagate:=True;

Tom

Back to top
Brion L. Webster
Guest





PostPosted: Thu Feb 17, 2005 9:50 pm    Post subject: Re: Opening a Crystal Report from Delphi Reply with quote

Brian Ellul wrote:

Quote:
It's very strange that things complicated so much! Through
Delphi2 all this was transparent to the developer.

Crystal Reports, for a while, essentially abandoned the VCL. The
guy who wrote it left, the folks who were still around didn't
understand Delphi, etc. After Crystal 7 was released, Frank
Zimmerman did a pretty outstanding job cleaning up the VCL (it's
still far from perfect), but then he went on to higher personal
callings.

AFAIK, Crystal's not that interested in supporting API based
printing any more, preferring to focus on their ActiveX and .NET
modules.

-Brion

Back to top
Brian Ellul
Guest





PostPosted: Fri Feb 18, 2005 9:34 am    Post subject: Re: Opening a Crystal Report from Delphi Reply with quote

Hi Tom

Quote:
Before running the report we will cycle thought the parameters
and assign values to the ones where NEEDSCURRENTVALUE is True and the
report has allows worked with sub reports.

This is what you mean regarding the cycle through the parameters?
ParamFields.Retrieve;
ParamFields[0].AsNumber:= a;
ParamFields[1].AsNumber:= b;
ParamFields[2].AsNumber:= 0;

I'm only going through the parameters of the main report. You I need to got
through the parameters of the subreports also? If yes will you please show
me how.
And what is the NEEDSCURRENTVALUE switch? Where do I find it? in Crystal or
the Delphi component?

BTW. I'm using IB7.1.

Regards
Brian

"Tom Wedge" <tom.wedge (AT) careervision (DOT) co.uk> wrote

Quote:
Brian Ellul wrote:

It's very strange that things complicated so much! Through Delphi2
all this was transparent to the developer.

Regards
Brian

"Brion L. Webster" <brion.webster (AT) nospam (DOT) ci.fresno.ca.us> wrote in
message news:42138dda (AT) newsgroups (DOT) borland.com...
Brian Ellul wrote:

I'm trying to export a report from Delphi5 using VCL7.5.0.51

However I have problems doing this when the report has got
subreports! I don't know if I need to pass the parameters to the
subreports as well.(Hope not)

Can someone please point me to any links or tell me what
properties I'll have to set.

IIRC, you have to iterate the subreports collection and all tables
in each subreport and set them all. I don't have the version 7 VCL
hanging around any more to double-check the help file.

Subreports are evil.

-Brion

Hi

We have never had to pass parameters down to the sub reports in Crystal
7 or 8. Before running the report we will cycle throught the parameters
and assign values to the ones where NEEDSCURRENTVALUE is True and the
report has allows worked with sub reports. The only thing you might
have truble with on a database engines like Sybase or MSSQL is that the
connection parameters are passed down to the sub reports which is done
by setting

Crpe1.Connect.Propagate:=True;

Tom



Back to top
Tom Wedge
Guest





PostPosted: Fri Feb 18, 2005 1:18 pm    Post subject: Re: Opening a Crystal Report from Delphi Reply with quote

Brian Ellul wrote:

Quote:
Hi Tom

Before running the report we will cycle thought the parameters
and assign values to the ones where NEEDSCURRENTVALUE is True and
the report has allows worked with sub reports.

This is what you mean regarding the cycle through the parameters?
ParamFields.Retrieve;
ParamFields[0].AsNumber:= a;
ParamFields[1].AsNumber:= b;
ParamFields[2].AsNumber:= 0;

I'm only going through the parameters of the main report. You I need
to got through the parameters of the subreports also? If yes will you
please show me how.
And what is the NEEDSCURRENTVALUE switch? Where do I find it? in
Crystal or the Delphi component?

BTW. I'm using IB7.1.

Regards
Brian

"Tom Wedge" <tom.wedge (AT) careervision (DOT) co.uk> wrote in message
news:42148630$1 (AT) newsgroups (DOT) borland.com...
Brian Ellul wrote:

It's very strange that things complicated so much! Through Delphi2
all this was transparent to the developer.

Regards
Brian

"Brion L. Webster" <brion.webster (AT) nospam (DOT) ci.fresno.ca.us> wrote in
message news:42138dda (AT) newsgroups (DOT) borland.com...
Brian Ellul wrote:

I'm trying to export a report from Delphi5 using VCL7.5.0.51

However I have problems doing this when the report has got
subreports! I don't know if I need to pass the parameters to the
subreports as well.(Hope not)

Can someone please point me to any links or tell me what
properties I'll have to set.

IIRC, you have to iterate the subreports collection and all
tables >> > in each subreport and set them all. I don't have the
version 7 VCL >> > hanging around any more to double-check the help
file.
Subreports are evil.

-Brion

Hi

We have never had to pass parameters down to the sub reports in
Crystal 7 or 8. Before running the report we will cycle throught
the parameters and assign values to the ones where
NEEDSCURRENTVALUE is True and the report has allows worked with sub
reports. The only thing you might have truble with on a database
engines like Sybase or MSSQL is that the connection parameters are
passed down to the sub reports which is done by setting

Crpe1.Connect.Propagate:=True;

Tom

Hi Brian

This outline code is lifted from the procedure that we use to open a
Crystal Report in a Report viewer that I worked on about 4 year ago.
At the time we used Crystal 7 and have upgraded it to Crystal 8 VCL and
Crystal 9 VCL with very little changes in the coding.

Crpe1.ReportName:=ReportFileName;

// Populate the Server connection parameters
Crpe1.Connect.ServerName:=ServerName;
Crpe1.Connect.DatabaseName:=DatabaseName;
Crpe1.Connect.Username:=Username;
Crpe1.Connect.Password:=Password;

// Make sure that all sub reports can also connect to the server
Crpe1.Connect.Propagate:=True;

// Cycle the Parameters for the Report only for those in the Main
report that require a user input value as you will see all internal
parameters as well.
for i:=0 to Crpe1.ParamFieldCount - 1 do
if Crpe1.ParamFields[i].NeedsCurrentValue=True then
begin
// I have left this part empty as we do not assign a value to the
parameter but it can be done as
// Crpe1.ParamFields[i].CurrentValues.Add(AValue);


// We do however setup
// 1. the Prompt for the parameter
// 2. the lookup values from our database
// the user then get presented with the Standard Parameter Prompt
dialog when Show is called.


end;

Crpe1.DiscardSavedData;
Crpe1.Show;

I must admit that I have an example program that Frank Zimmerman
shipped with the VCL when he was developing it. It is very good to help
you identify which properties need to be sent within the VCL.

Hope this helps

Tom


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.