Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old March 30th, 2007, 07:06 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default Binding a DataSet to Cystal Report

I have a sql select that calculates the sum of a "net" field and the max value of a "loads_today" field. The result is loaded into a DataSet (using vb code)


MyAdsSelect = "Select ticket_date, customer, customer_description_1, job,
job_phase, job_description_1, material, max(loads_today), sum(net) from
Salestkt where ticket_date =" & "'" & MyDate & "'" & "group by ticket_date,
customer, customer_description_1, job, job_phase, job_description_1,
material"


The DataSet, in addition to selected table fields, now have two additional columns, one for "max loads_today" and one for "sum of net value". The DataSet is bound to a DataGridView and diplayed. This works fine. Here is the code:

MyAdsAdapter.Fill(MyAdsDataset, "MyAdsDataTable")
DataGridView1.DataSource = MyAdsDataset.Tables("MyAdsDataTable")


I am also binding the same DataSet to a Crystal Report and it works fine except for the following: The report does not show the additional two calculated fields (it only shows the fields selected from the table that have been added to the Crystal report).

MyCrystalReport.SetDataSource(MyAdsDataset.Tables( "MyAdsDataTable"))
MyCrystalReportViewer.ReportSource = MyCrystalReport



Question: What do I need to do to show the max value of "loads_today" and the sum of the "net" field in Crystal Report since these tow field do not come from a table?

Thank you.




Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with cystal report sub reports RaghaSM Crystal Reports 0 July 10th, 2008 01:28 PM
VB 2005 and Cystal Report snufse Crystal Reports 1 December 4th, 2007 10:52 AM
Binding a menu with dataset zaghmout ASP.NET 2.0 Professional 1 August 14th, 2007 05:24 AM
binding the grid to dataset?? thas123 ASP.NET 2.0 Basics 1 December 27th, 2006 02:15 PM
Binding a Dataset to a Report ChrisLane Crystal Reports 4 March 9th, 2004 02:04 AM





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