Question Report question

gate7cy

Well-known member
Joined
May 11, 2009
Messages
119
Programming Experience
3-5
I am trying to do a report in VS/VB using Crystal Reports. In my report I am using 2 tables connected with customerID field. In the report all but one fields come from table1. The remaining field coming from table2 does not exist in table1 and is included in the report. The report when I run it only fills with the data from the table1. What I am trying to do is do something like a join and have fields from both tables . Thanks for the replies
 
Last edited:
Thanks Matt. Good tutorial bad very basic and has not given me something I do not know allready. The problem is that in this guide I have to give a path where the crystal report is located. My application is runned on multiple different computers and applying a valid path is diffircult. I mean my application will be published and when install on each pc I will have to copy/paste the report from my computer to the designated. Is there any other way to load the report without giving the path. Here is what I am using which does not work when I try to add fields from more than 2 tables. I only get the fields from table1 filled. The ones from table2 are empty::Thanks for the reply.

VB.NET:
     Dim rpt As New CrystalReport1() 'The report you created.

        Dim conn As OleDbConnection
        Dim MyCommand As New OleDbCommand
        Dim myDA As New OleDbDataAdapter
        Dim myDS As New Database2DataSet  'The DataSet we created

        Try

            conn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\Serverjde\jde\Database0.accdb;Persist Security Info=False;")
            MyCommand.Connection = conn
            MyCommand.CommandText = "SELECT * FROM AllServices ORDER BY StartDate ASC"
            MyCommand.CommandType = CommandType.Text
            myDA.SelectCommand = MyCommand

            myDA.Fill(myDS, "AllServices")
            rpt.SetDataSource(myDS)
            CrystalReportViewer1.ReportSource = rpt

        Catch Excep As Exception
            MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try




Tried this guy`s way step by step and what I get is an empty report with just page headers. I dont get even the report header to show up when I press the show button. In my attempt I get at least that. Pls assist:(
 
Last edited:
Back
Top