locked
crystal report issue RRS feed

  • Question

  • User1836339299 posted

    i have a stored procedure like this:

    ALTER PROCEDURE [dbo].[Sp_Quotation_Edit]
    @QuoteNo as int=null
    AS
    BEGIN
    Select * from Quotation where QuoteNo=@QuoteNo

    Select
    ItemDescrip as ItemName,
    Quantity,
    UnitPrice,
    SubTotal as Total,
    QuoteNumber,
    ItemNo
    from QuoteDetail where QuoteNumber=@QuoteNo
    END

    now then i select stoedproc in crystal report only one select query show not show both select query column. plz help ev1

    Thursday, May 2, 2013 7:21 AM

Answers

  • User-578610739 posted

    Hi,

    please alter your sp as

    ALTER PROCEDURE [dbo].[Sp_Quotation_Edit]
    @QuoteNo as int=null
    AS
    BEGIN
    
    Select q.*,
      ItemDescrip as ItemName,
      Quantity,
      UnitPrice,
      SubTotal as Total,
      QuoteNumber,
      ItemNo
    from Quotation q
    inner join QuoteDetail qd on  q.QuoteNo = qd.QuoteNumber
    where q.QuoteNo=@QuoteNo
    END

    This give the single desired table which have all column of your both table.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 3, 2013 1:17 AM

All replies

  • User-849598927 posted

    Either you have to create two stored procedure or write a single query combining both queries using inner join and use it..

    Thursday, May 2, 2013 7:40 AM
  • User-929656654 posted

    How do you take data from two different table in Crystal Report? 

    Well. You join the two tables based on some fileds. Your stored procedure returns two data sets, but Crystal report expects onely one. Modify your stored procedure to make a join between Quotation and QuotationDetail and then filter the join result based on the passed in param @QuoteNo

    Thursday, May 2, 2013 7:44 AM
  • User1381984600 posted


    The stored procedure must produce only one outputted SELECT statement. Any subsequent recordsets from the stored procedure will be ignored.

    You can try the above with multiple stored procedures.

    Ref: http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/d0b89e0d-2d40-2b10-099d-ff891e93ecb9?QuickLink=index&overridelayout=true

    Thursday, May 2, 2013 8:09 AM
  • User-578610739 posted

    Hi,

    please alter your sp as

    ALTER PROCEDURE [dbo].[Sp_Quotation_Edit]
    @QuoteNo as int=null
    AS
    BEGIN
    
    Select q.*,
      ItemDescrip as ItemName,
      Quantity,
      UnitPrice,
      SubTotal as Total,
      QuoteNumber,
      ItemNo
    from Quotation q
    inner join QuoteDetail qd on  q.QuoteNo = qd.QuoteNumber
    where q.QuoteNo=@QuoteNo
    END

    This give the single desired table which have all column of your both table.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 3, 2013 1:17 AM