
Crystal Reports with VB Pro 4.0
Quote:
> Is there a way to print reports from a data control with VB Pro 4.0
> and Crystal Reports 3.0 ?? I have a query system that I would like
> to add the option to print the results. By printing from the data
> control I wouldn't have to use Crystal Reports to execute yet another
> SQL query.
> Thanks in Advance!
> /*
> Andrew Carter
> Oak Ridge National Laboratory
> http://www.ornl.gov
> */
> /*
> Oak Ridge National Laboratory
> http://www.ornl.gov
> */Check out the bound control option of Crystal Reports. The process is something
like
1) Set the DataSource property to the Datacontrol on the form.
2) Set the ReportSource property to 3-All Data Control Fields
3) Click on the Custom property and scroll over to databound report (You have to
use the scroll arrow to see it) Click on Save Report As and give it a file name
4) Now use the Crystal Reports Designer using the file name you just gave to lay
out your report the way you want it. (Crystal defaulted to what it thought was the
best)
5) Back in your VB application, change the ReportSource property to 0-Crystal
Report. And the ReportName property to your file.
6) Now whenever you execute the query in your data control, that information will
be transferred to your report.
The big disadvantage to this method is that if your query changes such that
additional fields/tables are added, then you have to go through this entire process
again. If your report is a complicated layout, redesigning it a lot can be
cumbersum. One last note, I have the professional version of Crystal Reports. I am
not sure if the one that ships with VB4 has this bound report option.
--
Tim