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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AxCRViewer - Crystal Report

Status
Not open for further replies.

adale

Programmer
Apr 18, 2001
48
0
0
GB
Has anybody every seen example code for the active X viewer that comes with CR10. The examples on the Business Object site are all for the Crystal Report Viewer which doesn't have the funky data filter function.

Thanks
 
Why not use the .Net components and build in your "own funky data filters" through your .Net app?. The funkiness has probably been replaced with the ease of which you can manipulate ADO.Net Datasets


Sweep
...if it works, you know the rest..
Always remember that Google is your friend

curse.gif
 
Unfortunately I've got VB.Net and CR10. The functions in VB.Net are as closely tied to CR as the whole Visual Studio .Net package.
 
I use VB.Net and CR10 all the time.

1) Create a strong typed dataset within .NET
2) Point CR10 to this dataset
All this does is define the data template that the report will use.
3) Generate your data and populate a new instance of your dataset
4) Pass the Dataset to your report.
5) Show the report in the Viewer

There are lots of references out there as to how to integrate CR. If you need help with anything specific,please post back.



Sweep
...if it works, you know the rest..
Always remember that Google is your friend

curse.gif
 
I couldn't find an example that works. Here's what I have at the moment, though it changes as I try different things.
I dont attached recordsets to the reports as I want to use the DR designer independantly, and only have sufficient code in the app to show users a menu, then load the report.
What do you think?

Function LoadReport(ByVal strReportName As String)
Dim crxApp As New CRAXDDRT.Application
Dim crxRpt As CRAXDDRT.Report
Dim crxTables As CRAXDDRT.DatabaseTables
Dim crxTable As CRAXDDRT.DatabaseTable
Dim strreportpath As String
Dim strServerOrDSNName As String
Dim strDBNameOrPath As String
Dim strUserID As String
Dim strPassword As String

strServerOrDSNName = "servername"
strDBNameOrPath = "appname"
strreportpath = "" & Application.StartupPath & "\appname Reports\"
strUserID = ""
strPassword = ""

'// Open the report
crxRpt = crxApp.OpenReport("" & strreportpath & "" & strReportName & ".rpt")

'// Logon to the server
crxRpt.SetDatabaseLogon("", "", strServerOrDSNName, "appname")

For Each crxTable In crxRpt.Database.Tables
crxTable.SetLogOnInfo(strServerOrDSNName, "appname", "", "")
Next

'View the report
viewer.ReportSource = crxRpt
viewer.ViewReport()

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top