Help on Crystal Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gggram2000
    New Member
    • Nov 2007
    • 97

    #1

    Help on Crystal Reports

    hi there, I have a windows based program in visual studio 2005 using C# and sql server 2005 as backend.

    It's the first time I am trying to use Crystal reports, from what I have now is simply a table from the database and the crystal report viewer displays the entire table. I'ved been searching to see where I can enter a select statement that will allow me to decide which data I get on the report. So far I've read about Select Expert that's found in design view of the crystal reports in reports but I don't find anything like it. I'm also thinking maybe when creating the report there's somewhere where I can select or query specific data. If anyone would like to shed some light on this matter I'll appreciate it a lot.

    --GM
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    the select expert is where you can specify what to see and filter your data there.

    If you are quering on how to do this programatically , what i use is parameters.

    Add Parameters in your report and then edit select expert to the values of the parameters.

    When creating a report in .Net you can specify the parameters you are sending (which wil have to match that of the report)

    Comment

    • gggram2000
      New Member
      • Nov 2007
      • 97

      #3
      Originally posted by Shashi Sadasivan
      the select expert is where you can specify what to see and filter your data there.

      If you are quering on how to do this programatically , what i use is parameters.

      Add Parameters in your report and then edit select expert to the values of the parameters.

      When creating a report in .Net you can specify the parameters you are sending (which wil have to match that of the report)
      Yeah but I can't find any Select expert, there's no property to enable it...where can I find it?

      Comment

      • gggram2000
        New Member
        • Nov 2007
        • 97

        #4
        Hey, I've tried creating a dataset so that the report displays a certain data that i query. My code looks like this:

        Code:
        // getting the dataset
                        string connString = System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString");
                        string query = "Select * from SaleReceipts";                           
                        conn = new OleDbConnection(connString);
                        conn.Open();
                        da = new OleDbDataAdapter(query, conn);                                
                        ds = new DataSet();
                        da.Fill(ds,"SaleReceipts");    
                                        
                        // Crystal report code
                        Report1 rpt1 = new Report1();                
                        rpt1.SetDataSource(ds);                 
                        crystalReportViewer1.ReportSource = rpt1;
        My problem is that when the report displays it only displays the first row instead of all (*). Is there anything wrong with this code?

        Comment

        • Shashi Sadasivan
          Recognized Expert Top Contributor
          • Aug 2007
          • 1435

          #5
          have you tried opening up crystal reports and vieing the report there?

          check the report menu in the toolbar and it should have a select option.

          As of what i have seen, that menu appears atleast from 9.0 onwards

          Comment

          • gggram2000
            New Member
            • Nov 2007
            • 97

            #6
            Originally posted by Shashi Sadasivan
            have you tried opening up crystal reports and vieing the report there?

            check the report menu in the toolbar and it should have a select option.

            As of what i have seen, that menu appears atleast from 9.0 onwards
            Thanks for the help. I finally feel comfortable with crystalreports. I searched a tutorial where it explains about the pull and push method, basically I needed a push method for my report since I was querying specific data to display. I think if I was told about those methods from the beginning I wouldn't have had any problems with crystal reports.

            --GM

            Comment

            Working...