Nel

Nel

  • NA
  • 716
  • 1m

crystalReportViewer doesn't displays data from the dataset

Nov 15 2011 5:01 PM
Hi,

I have a crystalReport and crystalReportViewer doesn't display the vales from the table which I can see that the dataset has. When I run the report, it has only the names of the fields in the first raw, but doesn't display the other raws of the table. It doesn't through any error.

Here is part of my code:

string comstring = "SELECT NOVI.GBR as gbrnov, NOVI.AB as abnov, NALOG1.DATA as datanov,Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM,(Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA FROM (NALOG1 INNER JOIN MAGACIN ON NALOG1.GBRV=MAGACIN.GBR) INNER JOIN NOVI ON NALOG1.GBRV=NOVI.GBR where ( ( ( (NOVI.GBR)>=? And (NOVI.GBR)<=? ) ) AND ( (NOVI.AB)=?   or  (NOVI.AB)=?   )   AND  ( ( (NALOG1.DATA)>=?) and ((NALOG1.DATA)<=?) )   ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA";

......
......


DataSet2 dataSet2=new DataSet2();    
            //conn.Open();

             OleDbDataAdapter oleDBDataAdapter1 = new OleDbDataAdapter();
           
           
            oleDBDataAdapter1.SelectCommand=command;

                dataSet2.Clear();
                oleDBDataAdapter1.Fill(dataSet2);
                ReportDocument cryRpt = new ReportDocument();
                cryRpt.Load(@"C:\Potrosuvacka-Pregledi\Potrosuvacka-Pregledi\CrystalReport3.rpt");
                cryRpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
                cryRpt.SetDataSource(dataSet2);
                crystalReportViewer1.DisplayToolbar=true;
              
           
            crystalReportViewer1.ReportSource = cryRpt;                      
           
            crystalReportViewer1.Refresh();
                conn.Close();


Can anybody help me please?
Thank you very much in advance

Answers (1)