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

could anybody please help me out

Status
Not open for further replies.

ven

Programmer
Dec 28, 2000
8
US
could anybody please help me out

I created three parameters in my report.If the user didn't input any parameter and click just cancel ,I am getting the message user cancelled.if i clik ok the crystal report is blank.I am calling the crystal report from visualbasic frmmain form.I want the control goes to the frmmain form.
after cliking ok on the message "user cancelled".

thanks in advance
 
Show me the VB code for ok.click and cancel.click, and I'll try to tell you what is wrong.
 
hi malk,
I am giving the code as follows.
In frmmain select case for different types of reports.
Case REPORT_MINEPRODUCTS_BY_OWNER
Set objData = CreateObject("orderentry.clsMineProduct", g_intServerName)
blnSuccess = objData.getlistreport(rstData)

Set rptMainReport = appmain.OpenReport(AddDirSep(App.Path) & "rptMineProduct.rpt")
If rstData.RecordCount > 0 Then
For x = 1 To (rptMainReport.ParameterFields.Count)
Select Case rptMainReport.ParameterFields.Item(x).Name
Case "{?supplier}"
rstData.MoveFirst
If Not rstData.EOF Then
ReDim strstring(0)
strstring(0) = rstData("supplier")
rptMainReport.ParameterFields.Item(x).AddDefaultValue ("")
rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("supplier"))
For y = 1 To rstData.RecordCount
For z = 0 To UBound(strstring())
If strstring(z) = rstData("status") Then
blnexists = True
End If
Next
If blnexists = False Then
rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("Supplier"))
ReDim Preserve strstring(UBound(strstring()) + 1)
strstring(UBound(strstring())) = rstData("status")
End If
blnexists = False
rstData.MoveNext

Next
End If
Case "{?Product Status}"
rstData.MoveFirst
If Not rstData.EOF Then
ReDim strstring(0)
strstring(0) = rstData("status")
rptMainReport.ParameterFields.Item(x).AddDefaultValue ("")
rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("status"))
For y = 1 To rstData.RecordCount
For z = 0 To UBound(strstring())
If strstring(z) = rstData("status") Then
blnexists = True
End If
Next
If blnexists = False Then
rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("Status"))
ReDim Preserve strstring(UBound(strstring()) + 1)
strstring(UBound(strstring())) = rstData("status")
End If
blnexists = False
rstData.MoveNext
Next
End If

End Select
Next
End If

rptMainReport.Database.SetDataSource rstData


there are two parameters supplier and product status.when i run the report i get parameters popup and if I enter the parameters and then click on ok button ,i get the report.if click on cancel button ,i get the message 'user cancelled' .if click on ok the frmreport form is blank.i want the frmreport form shoud be unloaded and the control should goes to main menu form.

thanks
ven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top