Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Subreports not found.
Hi,

I have a developed an application using VB6, Sql Server 2005 and
Crystal Report 9. I use the CR control (crystl32.ocx) to print reports.

All the reports work fine.

But  If a report has  subreports, I need to reference the subreports in
order to set the database to them. I am using the GetNSubreports
method of the CR control, it always return zero indicating that the
report has no subreport.

I am really baffled at this behaviour. Why does it not return the
subreport count?


My code snippet is given below:

CR.ReportFileName = App.path & "\Test.rpt"
CR.Destination = crptToWindow

Y = CR.GetNSubreports()

Y always returns 0 even thought the Test.rpt report has subreports.


Please advice.

Thanks
Jatin


Report this thread to moderator Post Follow-up to this message
Old Post
jatinbhatt@gmail.com
04-11-06 12:05 AM


RE: Subreports not found.
You need to get away from using the CR Ocx. While I didn't have a problem
getting using the GetNSubreports, I did with RetrieveDataFiles after changin
g
to the subreport. The Ocx doesn't report back correctly using and
RetrieveDataFiles after changing to a subreport  (it always returns the
number of datafiles from the main report). The Ocx is also limited and has
some other quirks, along with being extremely outdated (last time it was
actually updated by CR was with the 6.0 version back in 1997 I believe)
Using it, you will have to know the subreports names ahead of time. Better
to  use the crystal report engine dll. There are examples on the CR CD or in
the installation folder, it the samples were installed.

As a temporary solution you can still reference the CR Engine while
continuing to use the OCX, just to get the number of subreports and their
datafiles for a certain Rpt.


"jatinbhatt@gmail.com" wrote:

> Hi,
>
> I have a developed an application using VB6, Sql Server 2005 and
> Crystal Report 9. I use the CR control (crystl32.ocx) to print reports.
>
> All the reports work fine.
>
> But  If a report has  subreports, I need to reference the subreports in
> order to set the database to them. I am using the GetNSubreports
> method of the CR control, it always return zero indicating that the
> report has no subreport.
>
> I am really baffled at this behaviour. Why does it not return the
> subreport count?
>
>
> My code snippet is given below:
>
>                 CR.ReportFileName = App.path & "\Test.rpt"
>                 CR.Destination = crptToWindow
>
>                 Y = CR.GetNSubreports()
>
> Y always returns 0 even thought the Test.rpt report has subreports.
>
>
> Please advice.
>
> Thanks
> Jatin
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Clinton
04-11-06 09:07 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic Crystal Reports archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:13 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.