Wrox Programmer Forums
|
BOOK: Professional Visual Studio 2010
This is the forum to discuss the Wrox book Professional Visual Studio 2010 by Nick Randolph, David Gardner, Chris Anderson, Michael Minutillo; ISBN: 9780470548653
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Visual Studio 2010 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 29th, 2012, 09:36 AM
Authorized User
 
Join Date: Apr 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default I fixed it!!! is working!!!---THANK YOU CHRIS

THANK YOU!!!!!!
 
Old April 29th, 2012, 10:39 PM
Authorized User
 
Join Date: Aug 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No worries.
__________________
Chris Anderson
Co-author
 
Old April 30th, 2012, 06:12 PM
Authorized User
 
Join Date: Apr 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display Name Field in Report from relationship

Hi Chris, the only thing left for me to finish the report application is to be able to do the following:

I have two related tables. The report dataset table has an integer field called Customer(many) and it is linked to another table called Customers which has a primary key called CustomerId(one) and that same table has another field called CustomerName. I want to be able to show in my report CustomerName. How can I do it? Please advise, thanks...

Dataset is based in an Entity Model, but I could do it from a dataset if necessary. Thanks again..
 
Old May 1st, 2012, 12:49 AM
Authorized User
 
Join Date: Aug 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There's 2 options. One is to simply include that related object in your query using the Include method (see the Navigating Entity Associations section in Chapter 29 of the book), and then use dot notation in your report to get to the property or properties you need. Alternativately, you can create a collection of anonymous objects, including the related field in the objects, like so:

var query =
from order in context.Orders
select new
{
OrderId = order.OrderID,
OrderDate = order.Date,
CustomerName = order.Customers.CustomerName
};
__________________
Chris Anderson
Co-author
 
Old May 1st, 2012, 10:41 AM
Authorized User
 
Join Date: Apr 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need to show related field from EF designer

When I choose the dataset from the report.rdlc design (New-Dataset...), a window comes up for me to be able to choose a New Dataset. Once I choose the DataSource, then I need to choose a dataset from "Available datasets" dropdownlist. I'm choosing a dataset based on a stored procedure in EF , GetTest(). What I need is that the related field appears in the fields list so that I can bind a report textbox to that related field. I sent you an email showing graphically.Please advise. Thank you very much.
 
Old June 6th, 2012, 03:42 PM
Authorized User
 
Join Date: Apr 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Typed DataSet Table query instead of a Entity

My subreport is working with Entity data. How would it be to have it working with a typed dataset? This is the code I thought would work but it isn't, please advise. GetData() is the name of the table adapter select procedure in the dataset. Thank you very much!!!
Code:
Private Sub ProcessSubreport(ByVal sender As System.Object, ByVal e As SubreportProcessingEventArgs)
        Dim cylinderid As Integer = Convert.ToInt32(e.Parameters("CylinderID").Values(0))
        Dim Context As New TestsDataSetTableAdapters.CylindersTableAdapter

        Dim qry = From cylinder In Context.GetData
        Where (cylinder.CylinderID = cylinderid)
        Select cylinder


        e.DataSources.Add(New ReportDataSource("DataSetC", qry))
    End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Management Chapter Listing 8-30 jayeshsatam BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 July 2nd, 2010 01:25 PM
Questions and Issues Chapters 3 and 4 egoodenuf BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 0 October 3rd, 2009 05:09 PM
Chapter 30, Registering Component Services slginps BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1 1 April 25th, 2009 01:24 PM
Chapter 7 Workflow setup issues and questions tdewey BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 3 April 20th, 2009 11:22 PM
Chapter 4 issues HenryT BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 June 9th, 2004 02:49 PM





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