Wrox Programmer Forums
|
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 April 2nd, 2006, 08:27 AM
Authorized User
 
Join Date: Aug 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Report with view

Hello,

   I have one crystal report made in crystal 9 which I am calling from asp.net page. I am using one view to get the data. I have to pass values to the view to get the conditioned data.
Now my problem is that, I am gettign the correct result using the queryanalizer and in xml file too, but crystalreportviewer is fetching all the record without checking the condition I am passing. Do you have any suggestion why it's coming like this.

crpt is the report,da is dataaapter,ds is dataset,tt is the view

Thanks
Ceema


crpt = New AnnualExamResult
        Dim cmd As New SqlCommand
        Dim Da As New SqlDataAdapter
        Dim Ds As New DataSet
        Dim SchoolID As String
        Dim ClassID As String
        Dim AcYear As String
        SchoolID = "ab1"
        ClassID = "Kg1-b"
        AcYear = "2005-2006"


        ' General log defenition
        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
        ' to get the formula values for the annual exam report

        Dim myConnection As SqlConnection
        Dim PName As String, mSql As String
               myConnection = New SqlConnection("server=IB; uid=sa; pwd=1; database=FS")
        Da = New SqlDataAdapter("Select * From tt where tt.SchoolID= '" & SchoolID & "' and tt.Class='" & ClassID & "' and tt.AcYear='" & AcYear & "'", myConnection)
        Da.Fill(Ds)


        Me.CrystalReportViewer1.Visible = True
        crpt.SetDataSource(Ds)
        CrystalReportViewer1.EnableDrillDown = False
        CrystalReportViewer1.DisplayGroupTree = False
        CrystalReportViewer1.ReportSource = crpt

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

        Dr1.Close()
 
Old April 4th, 2006, 02:45 AM
Authorized User
 
Join Date: Jan 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there,,,(ASAK)
I Think i have the solution to your Que?
According to my Analysis on Your code.. I think Your Report is already having the fields from database...that is ,,, in your rpt file .. u are assigning the tables from database and designed all the things as ussual..
now from code u r trying to change the database to DATASET . right,,,
So... This method is known as DATA PUSHING through DATASEt, It means it will push the data from data set to the report only when there is no data available. else it will ignore ur dataset...
in order to solve this issue,, USE .XSD data set.
i mean,,, IN place of ur dataset name use the name of .xsd data set..
like dim ds as dataset replace this bye...
dim ds as dataset1 and use this dataset in ur rpt file as a database.....
open ur rpt file... go to add/rmove databse...
there, u will find project data..
click that ,, and u will see ur .xsd dataset name over there, now this dataset will act like a complete database.. now wht ever u want to do. u can do through coding using this data set .
if u need the code ..or compelete rpt plus form then .. tell me,,IA ,, i will send u through email....
bye'
take care
AH

Mohammed Raza Ullah Khan





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to view more than 1 report simultaneously conn jdaulagar VB Databases Basics 0 November 30th, 2006 06:22 PM
Wroking with Report View anukagni Access 2 April 18th, 2006 12:31 AM
View Crysta Report using ASP3.0 shopgirl Classic ASP Professional 10 April 1st, 2006 03:52 AM
permission to view report collie BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 February 12th, 2005 05:13 PM
Login fail Err when view report on Report Server dillig BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 July 22nd, 2004 05:31 AM





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