CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Posts
    42

    blank report displayed at design & runtime

    QLSTR = "INSERT into temrp SELECT * FROM Table1 T" _
    & " LEFT JOIN PRDT P ON T.PID = P.PID" _
    & " JOIN CUSTOMER C ON T.CID= C.CID" _
    & " where month= '" & Month(dtpmonth.Value) & "' and year= '" & Year(dtpyear.Value) "


    Dim cmd As New SqlCommand(SQLSTR, conn)
    dim da as new sqldataadapter(cmd)
    dim table as new datatable
    da.Fill(table)

    Dim ReportName As String = "myreport.rpt"
    ReportName = Application.StartupPath & "\" & ReportName & ""

    If Not IO.File.Exists(ReportName) Then

    Throw (New Exception("Unable to locate report file:" & vbCrLf & ReportName))

    End If
    Dim ReportForm As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
    ReportForm.Load(ReportName)

    ReportForm.SetDataSource(Table)


    this is the code i am using

    i am using VS2005 with inbuilt crystal report

    i do have few recorrds in the table , even in debugging in the immediate window if i check table.rows.count it displays the count as 10

    but the crystal report appears blank


    even when i browse the fields in design view i get the data

  2. #2
    Join Date
    Jul 2005
    Posts
    1,083

    Re: blank report displayed at design & runtime

    I'm not sure if Crystal Reports accepts that kind of sql 'query'
    Could you try removing the 'Insert into Temp' part of the sql clause?

    JG

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured