PDA

Click to See Complete Forum and Search --> : RE: VB & CRYSTAL REPORT --TO QUERY ACCESS TABLE ??? STUCK !!!


tomtan
Aug 9th, 2000, 10:22 PM
You can use the Selection Formula of the Crystal Report.

Indraneel
Aug 9th, 2000, 11:03 PM
If you are using Crystal Report's OCX Control check with its selection criteria property which can be set within Visal Basic. For more help check on Developers.hlp in crystal directory.

Indraneel

Negative0
Aug 10th, 2000, 09:40 AM
I always create a separate table for reporting, so I can format it the way I want. If you create a new table for this report, then you can clear the table, and fill it only with the records you need for the report.

Hope this helps,

dcarlson
Aug 11th, 2000, 02:22 PM
I think the easiest way is to set your report datasource to a recordset that you create.

Such as:


Dim rstCurrent As ADODB.Recordset
Dim strSql As String
Dim Report1 As rptClient

Screen.MousePointer = vbHourglass

strSql = "SELECT * FROM client WHERE lastname = 'Smith' ORDER BY firstname"

'Load a form with the reportviewer control on it.

Load frmReport

'open your recordset

Set rstCurrent = New ADODB.Recordset
rstCurrent.Open strSql, fCnn1, adOpenForwardOnly, , adCmdText

'load your report

Set Report1 = New rptClient

'set your report's datasource

Report1.Database.SetDataSource rstCurrent

frmReport.crvCommon.ReportSource = Report1

frmReport.crvCommon.ViewReport

frmReport.crvCommon.Visible = True

frmReport.Show

Screen.MousePointer = vbDefault



Hope this helps.