none
ReportViewer and Relational Database RRS feed

  • Question

  • Hi All,
    I have a relational database, suppose I have a table "customer" and another "cardtype",  I want to show a report containing details of customers. customers table has a foreign key to the id of "cardtype" table, also in "cardtype" table there is a field named "name". What I want is: Instead of showing cardtype id in report for customers details I want to show cardtype name in the table. Its like retrieving cardtype name by using a where statement...
    Do you now a solution for this situation...

    Thanks in advance....
    Thursday, May 31, 2007 1:50 PM

All replies

  • Isnt there anybody?
    Friday, June 1, 2007 10:34 AM
  • I  dont understand ,,,havent any body out there tried to accomplish such a work, HELP!
    Friday, June 1, 2007 1:44 PM
  • Are you trying to do a simple Master/Detail setup?  I guess I'm a little confused as to what you want the final report to be like.  I would check out some of the sample code at http://www.gotreportviewer.com/ and see if you can find something there that is similar.

    Derek
    Friday, June 1, 2007 7:29 PM
  • What I want might be master and detail but I want to show results in a single table and show another field value(for example corresponding name from referenced table) for foreign keys rather than showing foreign key id...
    Saturday, June 2, 2007 8:59 PM
  • I understand now.  You could use a subreport, but that would be very inefficient.  Why don't you just join the two tables in your select statement?

    SELECT   C.CUSTOMER_NAME, C.CUSTOMER_ADDRESS, CT.CARD_NAME
    FROM     CUSTOMER C
    JOIN      CARD_TYPE CT ON C.CARD_ID = CT.CARD_ID

    Try that and let me know what happens.

    Derek
    Monday, June 4, 2007 5:58 PM