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 February 16th, 2006, 12:26 AM
Authorized User
 
Join Date: Aug 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default What is wrong witht his crystal report code

Hello,

I am using the following code to retrieve my report. I am using Asp.net(version 1.1) & sql 2000 & Crystal Reports 9. My query is retrieving exact result to the xml file, but crystal report is not retrieving the exact result, it's not taking the condition of the query, it simpy shows all teh recrds in the table. Can you please help me to solve this

Thanks
Ceema

crpt = New BlueRegisterEnglish

'crpt = New Form1A
'************
Dim cmd As New SqlCommand
Dim Da As New SqlDataAdapter
Dim Ds As New DataSet
Dim SchoolID As String
SchoolID = "AB0"
Dim ClassID As String
ClassID = "1-A"
'**********

For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = "IBRA"
myLogin.ConnectionInfo.DatabaseName = "FSchool"
myLogin.ConnectionInfo.Password = "123"
myLogin.ConnectionInfo.UserID = "sa"
myTable.ApplyLogOnInfo(myLogin)
Next
'********
Dim myConnection As SqlConnection
Dim mySqlDataAdapter As SqlDataAdapter

myConnection = New SqlConnection("server=IBRA; uid=sa; pwd=123; database=FSchool")
Da = New SqlDataAdapter("Select * From tmpblueregister Where SchoolID = '" & SchoolID & "' and class= '" & ClassID & "'", myConnection)
Da.Fill(Ds, "TmpForm1A")
crpt.SetDataSource(Ds.Tables(0))
Ds.WriteXml("c:\backups\testfile.xml")
CrystalReportViewer1.ReportSource = crpt






Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for Exporting Crystal Report to Excel or PDF shakti_2505270 ASP.NET 2.0 Professional 1 October 4th, 2007 01:00 AM
Crystal Report 11 subreport code.... intellogo Pro VB Databases 0 April 7th, 2007 08:46 AM
Crystal Report displays wrong value. shilpa_net2004 VB Databases Basics 2 December 31st, 2005 12:09 PM
Crystal Report displays wrong value. shilpa_net2004 Crystal Reports 0 December 13th, 2005 04:30 AM
Calling Crystal report from Java code anubhav.kumar BOOK: Beginning Java 2, JDK 5 Edition 0 May 24th, 2005 08:46 AM





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