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();