Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal Reports - subreport - print to file problem

Posted on 2001-08-06
11
Medium Priority
?
429 Views
Last Modified: 2008-01-09
I have lot of reports designed with Crystal reports with sub reports in them. Now, using Crystal OCX control from VB, when I set a formula for the subreport and try to print to file, I get an error no. 20997 with lots of '?' in the error message, and some other characters in it (like '???t??????????? ?'). But it prints to Window fine. Only to print to file, I get problem.

The vb code is like this:

CrystalReport1.ReportFileName = "PsStk001.rpt"

CrystalReport1.SubReportToChange = "PsStkSel.rpt"

CrystalReport1.Formulas(1) = "vbCaption1 = 'Department'"
CrystalReport1.Formulas(2) = "vbField1 = 'D1'"

CrystalReport1.SubReportToChange = ""

CrystalReport1.Destination = crptToFile
CrystalReport1.PrintFileType = crptCrystal
CrystalReport1.PrintFileName = "C:\a.rpt"

CrystalReport1.Action = 1

This happens, to almost all reports with subreports. Any ideas please, we need to set right all those reports, that give this problem.
0
Comment
Question by:Valliappan AN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 12

Accepted Solution

by:
Preece earned 600 total points
ID: 6357546
It might just be a problem with your report having a subreport.  Make a copy of an existing report, remove the subreport, then try again.  If it prints to file ok, then maybe consider doing your report without the subreport.  Not sure if this will help, I just remember overhearing another developer haveing lots of trouble with subreports....


Preece
0
 
LVL 9

Author Comment

by:Valliappan AN
ID: 6358000
Preece,

Thanks for the comment. But it is not one report I am having this problem. Almost all reports, having subreport work fine when I dont set the formulas property from VB. Also, when I set formulas from VB and print to Window then it works fine.

But only when I export to file, in RPT format, I get this problem. I found that I could do it without sub-report, but then it will take me lot of time to convert, since, I need to pass around 30 formulae to the form, which then I might need to do all subreport parts in the main report, for all those reports.
0
 
LVL 12

Expert Comment

by:Preece
ID: 6359786
There is a setting in Crystal, in two places, that allow for "more descriptive error messages".  Make sure you set it in both places...  

Preece
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 9

Author Comment

by:Valliappan AN
ID: 6362444
Could you tell me where to set it or where from I could get the info?
0
 
LVL 12

Expert Comment

by:Preece
ID: 6364676
Valli...I haven't had Crystal in my current job for 10 months, but I think that you should look under Options and Report Options.  Make sure that you select it in both locations.  This was the case with Crystal 6.0 when I used to use it.

Good luck,
Preece
0
 
LVL 9

Author Comment

by:Valliappan AN
ID: 6366698
I found what you were referring. It is "More Report Engine Error Messages" in both Options and Report Options. The Options one is already selected in my CR7. In report, it is un-clicked. Let me give a try and report it.
0
 
LVL 9

Author Comment

by:Valliappan AN
ID: 6459884
Preece,

So far no luck. Any other ideas?
0
 
LVL 9

Author Comment

by:Valliappan AN
ID: 6826535
Well, found a workaround for the problem. Thanks for your help.
0
 
LVL 9

Author Comment

by:Valliappan AN
ID: 6826539
I used the subreports, but with a dummy 'Shared ' like,

Shared StringVar SubReportTitle:="1";

declaration there, and it works without problems, when setting formulas. Somehow, it handles the problem. :)
0
 
LVL 12

Expert Comment

by:Preece
ID: 6829329
Well, eh, thanks for the points!  Did the "More Report Engine Error Messages" help?  Or did you just want award the points?

Thanks again,
Preece
0
 
LVL 9

Author Comment

by:Valliappan AN
ID: 6829393
Nope, I learnt that, but it did not help. Points for your assistance, as I learn from one qn. that you can award also for assistance. :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question