Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vb Front End

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
GB
I have a set of crystal reports. However a VB front is now required. I have a few questions.

Is this difficult?

I want my own parameter input screen, not the cystal one. So I need to pass paras from the VB app to the crystal report.

When the report opens does the who crystal app have to open.

When the report opens i don't the user to see the design view or be able to use the crystal refresh button. All I need is the report to be displayed.

Could anyone tell me how i go about this, or point me in the right direction

ta
 
EscapeUK - I can't say for certain that the same is true of VB but the following is true for accessing Crystal Reports through Delphi 5 code - I think from examples I've seen that VB works in a similar manner.
I pass parameters to the report such that I allow report objects to be seen or not accordingly (using object visibility formulas)
The Crystal Report application (crw32.exe) does not activate when you access a report through code.
I use a 'CRViewer' (Cystal Reports Viewer Active X component) in my code - this shows the preview of the report with data and not the design view.
I would assume the same facts are true of running Crystal Reports through VB - maybe someone can confirm this ?
Hope this helps a little.
Steve
 
StevenK is correct.

I have built a report displaying application that interacts with the command line arguments passed to it.

You can pass any report RPT file to it, any parameters, and username/password, and it then loads that report, and does it all accordingly.

Using VB, you CAN make all the "normal buttons" like refresh, export, next/prev be hidden. And you can set the parameters equal to whatever you want.

You can even make your own buttons to interact with the report.

I used the Crystal Report Viewer Control (crviewer.dll) and the Crystal Report 7 ActiveX Designer Run Time Library (craxdrt.dll). You programatically create the CRAXDRT.Application, have it create a new CRAXDRT.Report, and then set that as the source of the crviewer control. From there, you can manipulate the report.
 
There is another work round. Try this..

Dim ImpApp As Application
Dim ImpRep As Report
Dim ImpPrintWindow As PrintWindowOptions
Dim Param As ParameterFieldDefinitions
Dim Param1 As CRPEAutoParameterFieldDefinition
Dim ImpDatabaseField as DatabaseFieldDefinition


Set ImpApp = CreateObject("Crystal.CRPE.Application")
Set ImpRep = ImpApp.OpenReport(Report name)
Set PrintWindow = ImpRep.PrintWindowOptions
With PrintWindow
.HasGroupTree = True
.HasCloseButton = True
.HasNavigationControls = True
.HasCancelButton = True
.CanDrillDown = True
.HasExportButton = True
.HasNavigationControls = True
.HasGroupTree = True
.HasPrintButton = True
.HasPrintSetupButton = True
.HasProgressControls = True
.HasRefreshButton = True
.HasSearchButton = True
.HasZoomControl = True
End With

Set Param = ImpRep.ParameterFields
Param(1).SetCurrentValue Val("Parameter value")
ImpRep.Preview
It'll work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top