Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 29th, 2006, 12:37 AM
Authorized User
 
Join Date: Aug 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Report not accepting the condition

Hello,
I have createc view for two tables and I am trying to get report according to a condition(search by schoolid). The problem is, in the second query (denoted with '*****) is not retrieving the records accroding to the condition. It's simply retriecving all the record. Can anyone help me. Throug the query , in my xml file, I am geting the exact result. And I have tried to print Response.Write(Ds.Tables(0).Rows.Count), it's retrieving the exact number of rows, but the report viewer is displying wrong result.

Thanks
Ceema


crpt = New Admini
        Dim cmd As New SqlCommand
        Dim Da As New SqlDataAdapter
        Dim Ds As New DataSet
        Dim SchoolID As String
             Dim ClassID As String
             SchoolID = "Ab1"
        ClassID = "1-A"
        For Each myTable In crpt.Database.Tables
            myLogin = myTable.LogOnInfo
            myLogin.ConnectionInfo.ServerName = "IB"
            myLogin.ConnectionInfo.DatabaseName = "FS"
            myLogin.ConnectionInfo.Password = "1"
            myLogin.ConnectionInfo.UserID = "sa"
            myTable.ApplyLogOnInfo(myLogin)
        Next
        ' **********get the result from view....>This is not checking the condition******************
        SchoolID = "Ab0"
        Dim Con As SqlConnection
        Con = New SqlConnection("server=IB; uid=sa; pwd=1; database=FS")
        Da = New SqlDataAdapter("Select * From vAdminDetailRpt where SchoolID= '" & SchoolID & "'", Con)

        Da.Fill(Ds)
        Me.CrystalReportViewer1.Visible = True
        crpt.SetDataSource(Ds.Table(0))
        CrystalReportViewer1.EnableDrillDown = False
        CrystalReportViewer1.DisplayGroupTree = False
        crpt.PrintOptions.PageMargins.topMargin.Equals(0)
        CrystalReportViewer1.ReportSource = crpt

        Ds.WriteXml("c:\backups\testfile.xml")
        Con.Close()

        Da.Dispose()
        Ds.Dispose()

    End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Accepting Passwords in C++ aix_kernel C++ Programming 0 August 9th, 2008 12:58 AM
Accepting Connections js_newbie Linux 0 April 25th, 2007 05:29 AM
Is it possible to display report on condition? megana Crystal Reports 0 June 30th, 2006 04:30 PM
Accepting time input GuyB ASP.NET 1.0 and 1.1 Basics 0 May 11th, 2006 06:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.