Data Connectivity
 Crystal Reports Forum : Crystal Reports .NET 2003 : Data Connectivity
Message Icon Topic: connect crystal report to ado.net dataset Post Reply Post New Topic
Author Message
tornado_12
Newbie
Newbie


Joined: 31 Mar 2009
Online Status: Offline
Posts: 1
Quote tornado_12 Replybullet Topic: connect crystal report to ado.net dataset
    Posted: 31 Mar 2009 at 5:51am
hi everyone
 i did created an ado.net dataset and put four tables in it. i set it as the data source for my crystal report form but when i run my application i get nothing this is my code please helpCry
 
code
 

Open_Con()'open database connection

Dim cryRpt10 As New ReportDocument

cryRpt10.Load(Application.StartupPath & "\test10.rpt")

Dim ds As New Mydataset

Dim SQLa As String = "SELECT table1.Num,table2.name,table3.name,table1.Date,table4.Date,table4.prise from table2 INNER JOIN (table1 INNER JOIN (table4 INNER JOIN table3 on table4.code=table3.code)on table1.Num=table4.Num) ON table2.Codef=table1.Codef where table1.Num= " & n & ""

'n as integer (number)

Dim DataAdapter As New OleDbDataAdapter(SQLa, Con)

DataAdapter.Fill(ds)

cryRpt10.SetDataSource(ds)

Close_Con()'close database connection

form1.CrystalReportViewer1.ReportSource = cryRpt10

form1.CrystalReportViewer1.Refresh()

form1.Show()

thinks for your suggestions

IP IP Logged
dazel
Newbie
Newbie


Joined: 31 Mar 2009
Location: India
Online Status: Offline
Posts: 6
Quote dazel Replybullet Posted: 02 Apr 2009 at 2:59am
hi,
   what ever you have done is correct but is incomplete.
   Continue with these steps.
 
Adding .xsd file to project, then create datatables in your XSD file.(you can google about how to  add datatable to your XSD file)
 
Map the tables with Crystal Report by following the wizard to create crystal report.
 
Also remember to copy your dataset data i.e. 'ds' to the XSD's datatable.
this link can help you.
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.