discrepancy between data in dataset and data reported by Crystal viewer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JK

    discrepancy between data in dataset and data reported by Crystal viewer

    In my Windows form, I have a discrepancy between what the CrystaReport
    viewer displays and what the dataset contains. The Report displays data
    from three fields from same table but the reportviewer displays all the data
    in the table regardless of the select I run (in this case, the select
    returns only one record):

    test MyRpt = new test();
    DataSet DS_MyReportsDS = new DataSet();
    SqlConnection SQLConn = new SqlConnection(" Data Source=localhos t; Integrated
    Security=SSPI;" +
    "Initial Catalog=invoici ng");
    string strThisQuery = "select clientid,fname, lname1 from clientdata where
    clientid = '00001' "; //I should only get one record but the viewer
    displays all of them
    SqlDataAdapter MyDataAdapterCl ients = new SqlDataAdapter (strThisQuery,
    SQLConn);
    MyDataAdapterCl ients.Fill(DS_M yReportsDS);
    MyRpt.SetDataSo urce (DS_MyReportsDS );
    crystalReportVi ewer1.ReportSou rce = MyRpt;

    I didn't save the report with the data.

    Thanks.


  • Dishan

    #2
    Re: discrepancy between data in dataset and data reported by Crystal viewer

    hey.. change ur system clock!!!

    "JK" <NONE> wrote in message news:#KfP#JycDH A.3308@tk2msftn gp13.phx.gbl...[color=blue]
    > In my Windows form, I have a discrepancy between what the CrystaReport
    > viewer displays and what the dataset contains. The Report displays data
    > from three fields from same table but the reportviewer displays all the[/color]
    data[color=blue]
    > in the table regardless of the select I run (in this case, the select
    > returns only one record):
    >
    > test MyRpt = new test();
    > DataSet DS_MyReportsDS = new DataSet();
    > SqlConnection SQLConn = new SqlConnection(" Data Source=localhos t;[/color]
    Integrated[color=blue]
    > Security=SSPI;" +
    > "Initial Catalog=invoici ng");
    > string strThisQuery = "select clientid,fname, lname1 from clientdata where
    > clientid = '00001' "; //I should only get one record but the viewer
    > displays all of them
    > SqlDataAdapter MyDataAdapterCl ients = new SqlDataAdapter (strThisQuery,
    > SQLConn);
    > MyDataAdapterCl ients.Fill(DS_M yReportsDS);
    > MyRpt.SetDataSo urce (DS_MyReportsDS );
    > crystalReportVi ewer1.ReportSou rce = MyRpt;
    >
    > I didn't save the report with the data.
    >
    > Thanks.
    >
    >[/color]


    Comment

    • Kevin Yu

      #3
      RE: discrepancy between data in dataset and data reported by Crystal viewer

      Hi JK,

      In your code, MyRpt is an instance of "test" type. Is "test" a kind of
      ReportDocument? If it contains the schema of all the columns, the
      CrystalReportVi ewer will display all the data in the table regardless of
      your select.

      In addition to posting your question here, also look at
      http://www.crystaldecisions.com/. Though it ships with Visual Studio,
      Crystal Reports is supported by Crystal Decisions. They have a self-help
      section and they offer phone & e-mail support. Their web sites states that
      you get two Crystal incidents with the purchase of Visual Studio .NET.

      If anything is unclear, please feel free to reply to the post.

      Kevin Yu
      =======
      "This posting is provided "AS IS" with no warranties, and confers no
      rights."

      Comment

      • JK

        #4
        Re: discrepancy between data in dataset and data reported by Crystal viewer

        "test" is test.rpt, a Crystal report. What would I need to do so the
        CrystalReportVi ewer displays just the data in my Select? Is the change in
        the code or in the report creation?
        Thanks.

        "Kevin Yu" <v-kevy@online.mic rosoft.com> wrote in message
        news:H1kD$p3cDH A.1656@cpmsftng xa06.phx.gbl...[color=blue]
        > Hi JK,
        >
        > In your code, MyRpt is an instance of "test" type. Is "test" a kind of
        > ReportDocument? If it contains the schema of all the columns, the
        > CrystalReportVi ewer will display all the data in the table regardless of
        > your select.
        >
        > In addition to posting your question here, also look at
        > http://www.crystaldecisions.com/. Though it ships with Visual Studio,
        > Crystal Reports is supported by Crystal Decisions. They have a self-help
        > section and they offer phone & e-mail support. Their web sites states that
        > you get two Crystal incidents with the purchase of Visual Studio .NET.
        >
        > If anything is unclear, please feel free to reply to the post.
        >
        > Kevin Yu
        > =======
        > "This posting is provided "AS IS" with no warranties, and confers no
        > rights."
        >[/color]


        Comment

        • Kevin Yu

          #5
          RE: discrepancy between data in dataset and data reported by Crystal viewer

          Hi JK,

          I think you have to change the schema of your test.rpt file. Make sure it
          has the same schema as you datasource.(Mak e it contains only 3 column you
          need.)

          In addition to posting your question here, also look at
          http://www.crystaldecisions.com/. Though it ships with Visual Studio,
          Crystal Reports is supported by Crystal Decisions. They have a self-help
          section and they offer phone & e-mail support. Their web sites states that
          you get two Crystal incidents with the purchase of Visual Studio .NET.

          Kevin Yu
          =======
          "This posting is provided "AS IS" with no warranties, and confers no
          rights."


          Comment

          Working...