Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Report Control DataSource
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report Control DataSource

 Post Reply Post Reply
Author
Message
white6174 View Drop Down
Newbie
Newbie


Joined: 21 July 2011
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote white6174 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
white6174 View Drop Down
Newbie
Newbie


Joined: 21 July 2011
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote white6174 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2011 at 12:40am
in vb6

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

where rs is your recordset object

Back to Top
white6174 View Drop Down
Newbie
Newbie


Joined: 21 July 2011
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote white6174 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.