|  | 
| Report Control DataSource | 
| Post Reply   | 
| Author | |
| white6174   Newbie   Joined: 21 July 2011 Location: United States Status: Offline Points: 3 |  Post Options  Thanks(0)  Quote  Reply  Topic: Report Control DataSource Posted: 21 July 2011 at 11:25am | 
| I'm trying something that I think should be very simple, I loaded a SQL table into a strongly typed dataset, now I want to assign it to the report control, I tried to do it the same way you would with a datagridview, but it gives me an error "Specified cast not valid" Any ideas, I cant seem to find any samples showing how to attach to a SQL data source or datatable. thanks for any help you may be able to provide  steve //code  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         Me.InvMasterTableAdapter.Fill(Me.DataSet1.InvMaster)         AxReportControl1.DataManager.DataSource = Me.DataSet1.InvMaster         DGV1.DataSource = Me.DataSet1.InvMaster     End Sub | |
|  | |
| white6174   Newbie   Joined: 21 July 2011 Location: United States Status: Offline Points: 3 |  Post Options  Thanks(0)  Quote  Reply  Posted: 27 July 2011 at 2:38pm | 
| 
   Maybe I'll simplify my question, Can someone show an example of how to use SQL as a datasource for the report control. (I must be doing it wrong) | |
|  | |
| Aaron   Senior Member   Joined: 29 January 2008 Status: Offline Points: 2192 |  Post Options  Thanks(0)  Quote  Reply  Posted: 28 July 2011 at 12:14am | 
| 
     Product: Xtreme SuitePro (ActiveX) version 15.0.2 
 Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... | |
|  | |
| younicke   Senior Member     Joined: 11 March 2005 Status: Offline Points: 107 |  Post Options  Thanks(0)  Quote  Reply  Posted: 28 July 2011 at 12:40am | 
| 
   in vb6 Set wndReport.DataManager.DataSource = rs wndReport.DataManager.DataBind where rs is your recordset object | |
|  | |
| white6174   Newbie   Joined: 21 July 2011 Location: United States Status: Offline Points: 3 |  Post Options  Thanks(0)  Quote  Reply  Posted: 01 August 2011 at 3:37pm | 
| 
   I still have an issue, I tried using the supplied examples, I'm using VB.net 2010, the newest demo of the codejock controls, this is what I have so far, it loads columns but no data   any ideas?   Try             Dim cn As New ADODB.Connection()             Dim rs As New ADODB.Recordset()             Dim cnStr As String             Dim cmd As New ADODB.Command()             cnStr = "Provider=SQLOLEDB;Initial Catalog=DB_Test1;Data Source=DELL_LAP;" & _    "User ID=SysApp;Password=password;"             cn.Open(cnStr)             rs = cn.Execute("SELECT     dbo.ArCustomer.* FROM         dbo.ArCustomer")             With Me.AxReportControl1                 With .DataManager                     .DataSource = rs                     .DataBind()                 End With             End With             rs.Close()             cn.Close()         Catch ex As Exception             MsgBox(ex.ToString)         End Try | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  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 |