Print Page | Close Window

Report Control DataSource

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18700
Printed Date: 10 July 2024 at 9:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control DataSource
Posted By: white6174
Subject: Report Control DataSource
Date 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



Replies:
Posted By: white6174
Date 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)


Posted By: Aaron
Date Posted: 28 July 2011 at 12:14am
Hi,
 
Maybe this will help: http://forum.codejock.com/forum_posts.asp?TID=14721&KW=SQL&PID=50863&title=report-control-databind-for-sql-lite#50863 - http://forum.codejock.com/forum_posts.asp?TID=14721&KW=SQL&PID=50863&title=report-control-databind-for-sql-lite#50863
 
 
 
 


-------------
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....


Posted By: younicke
Date Posted: 28 July 2011 at 12:40am
in vb6

Set wndReport.DataManager.DataSource = rs
wndReport.DataManager.DataBind

where rs is your recordset object



Posted By: white6174
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net