%% Santo %% <[EMAIL PROTECTED]> wrote:
>how do i call a crystal report form in visual basic
>can u guys give me an example
>regards
>santo
>
Hello
To use crystal report in VB6 you should add its component to VB at first(CTRL+T
then check Crystal Report Viewer Control) after that you can see the Crviwer
control on your toolbox add it to form then right click on the project window
and add a crystal designer to it.Now you should design your report and set its
data fields...
or u can set its data fields from codes of your form.like this
Private Sub Form_Load()
Dim m_Report As New CrystalReport1
Dim adoRs As ADODB.Recordset
Dim SQL As String
SQL = "SELECT" & _
" tblstudent.`id`,tblstudent.`name`,
tblstudent.`family`,tblstudent.`sex`, " & _
"
`tblresultALL`.`lessonname`,`tblresultALL`.`tr`,`tblresultALL`.`fa`,`tblresultALL`.`dc`,
" & _
"`tblresultALL`.`per`,`tblresultALL`.`midper`,`tblresultALL`.`bestper`, " & _
"`tblresultALL`.`taraz`,`tblresultALL`.`rotbe`,tblstudent.`tarazomu`,tblstudent.`tarazekh`,tblstudent.`tarazkol`,tblstudent.`rotbeomu`,tblstudent.`rotbeekh`,tblstudent.`rotbekol`,tblstudent.`unit`"
& _
" From" & _
" `tblstudent` INNER JOIN `tblresultALL` ON " & _
" tblstudent.`ID` = `tblresultALL`.`ID` "
' Create and bind the ADO Recordset object
Set adoRs = CreateObject("adodb.recordset")
adoRs.Open SQL, "Provider=microsoft.jet.oledb.4.0;data source=" +
DBPath, adOpenKeyset, adLockBatchOptimistic
m_Report.Database.SetDataSource adoRs
m_Report.Text1.SetText SarTitr
m_Report.Text3.SetText EXid
m_Report.Text4.SetText Dt
m_Report.Text5.SetText NOP
CRViewer1.ReportSource = m_Report
CRViewer1.ViewReport
End Sub
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12h8b40v6/M=362335.6886445.7839731.1510227/D=groups/S=1705115364:TM/Y=YAHOO/EXP=1124577966/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In
low income neighborhoods, 84% do not own computers. At Network for Good, help
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
'// =======================================================
Rules : http://ReliableAnswers.com/List/Rules.asp
Home : http://groups.yahoo.com/group/vbHelp/
=======================================================
Post : [email protected]
Join : [EMAIL PROTECTED]
Leave : [EMAIL PROTECTED]
'// =======================================================
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/vbhelp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/