Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
| Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2004, 02:32 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating reports using dataset

how to create report using dataset?
I am trying with below code, its not giving me error but, when this code is executed, I dont see any records. But, When I run it at sql I see the record.
whats the other best way to solve this problem (accessing multiple tables to dataset and dataset to report)?

ALL SEVEN TABLES ARE ADDED TO DATASET ds.XSD
Dim conn As SqlConnection
Dim da1 As SqlDataAdapter
Dim da2 As SqlDataAdapter
Dim da3 As SqlDataAdapter
Dim da4 As SqlDataAdapter
Dim da5 As SqlDataAdapter
Dim da6 As SqlDataAdapter
Dim da7 As SqlDataAdapter
Dim connstr As String = "server=nt360dbs2;uid=sa;pwd=goblue2002;database=t co"
conn = New SqlConnection(connstr)
If conn.State = ConnectionState.Open Then conn.Open()
Dim ds As New DataSet

Dim qry1 As String = "Select * from claims where claims.ccanbr='" & txtccanbr.Text & "'"
da1 = New SqlDataAdapter(qry1, conn)
da1.Fill(ds, "claims")

Dim qry2 As String = "Select * from claimtextfailure where ccanbr='" & txtccanbr.Text & "'"
da2 = New SqlDataAdapter(qry2, conn)
da2.Fill(ds, "claimtextfailure")

Dim qry3 As String = "Select * from part360 where ccanbr='" & txtccanbr.Text & "'"
da3 = New SqlDataAdapter(qry3, conn)
da3.Fill(ds, "part360")

Dim qry4 As String = "Select * from claimtypecodes Inner Join Claims ON ClaimTypeCodes.[CCA Type]=Claims.CCAType where Claims.ccanbr='" & txtccanbr.Text & "'"
da4 = New SqlDataAdapter(qry4, conn)
da4.Fill(ds, "claimtypecodes")

Dim qry5 As String = "Select * from Inventorylist INNER JOIN Claims ON Claims.FPARTNOSPACE=InventoryList.PartNumber Where Claims.ccanbr='" & txtccanbr.Text & "'"
da5 = New SqlDataAdapter(qry5, conn)
da5.Fill(ds, "InventoryList")

Dim qry6 As String = "Select * from tLBRHR360 where ccanbr='" & txtccanbr.Text & "'"
da6 = New SqlDataAdapter(qry6, conn)
da6.Fill(ds, "tLBRHR360")


'Dim qry7 As String = "Select * from vendorinfo INNER JOIN InventoryList ON InventoryList.PrimaryVendor=VendorInfo.VendorNum"
'da7 = New SqlDataAdapter(qry7, conn)
'da7.Fill(ds, "vendorinfo")

crv.Visible = True
rpt.Database.Tables(0).SetDataSource(ds)
'rpt.SetDataSource(ds.Tables(0))
crv.ReportSource = rpt
conn.Close()





Similar Threads
Thread Thread Starter Forum Replies Last Post
creating xslt from dataset in .net sudhir164 .NET Framework 2.0 2 December 4th, 2007 12:16 AM
Creating DataSet/DataTable from XML hhmoeller XML 4 March 22nd, 2006 10:41 AM
Creating a Crystal Report from a runtime dataset vbmazza ASP.NET 1.0 and 1.1 Basics 0 March 17th, 2006 07:40 AM
Creating a new table from a dataset... vb_developer SQL Server ASP 4 September 21st, 2004 07:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.