Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crystal Report based SQL query more then two table Post Reply Post New Topic
Author Message
Abrahm75
Newbie
Newbie
Avatar

Joined: 19 Aug 2009
Location: Sweden
Online Status: Offline
Posts: 1
Quote Abrahm75 Replybullet Topic: Crystal Report based SQL query more then two table
    Posted: 19 Aug 2009 at 2:27am
Hi All, i have a big problem with the crystal report ... my code is :

       ReportDocument RD = new ReportDocument();

       string ConnectionString = ConfigurationManager.ConnectionStrings["zaza"].ConnectionString;

       SqlConnection conn = new SqlConnection(ConnectionString);

       conn.Open();

       SqlDataAdapter adp = new SqlDataAdapter("SELECT kund2.fornamn, kund2.efternamn, kund2.namn, kund2.telenr, kund2.mobilnr, kund2.faxnr, kund2.epost, kund2.persnr, kund2.fakgata1,kund2.fakgata2,kund2.fakpostaddrs, kund2.fakpostnr, kontrakt.Leadsource, kontrakt.KontraktID, kontrakt.KundID, Bokningar.seid, Produktyper.ProduktNamn FROM Bokningar INNER JOIN kund2 INNER JOIN kontrakt ON kund2.KundID = kontrakt.KundID ON Bokningar.KontraktID = kontrakt.KontraktID INNER JOIN Produktid ON Bokningar.ProduktID = Produktid.ProduktID INNER JOIN Produktyper ON Produktid.ProduktTypID = Produktyper.ProduktTypID WHERE(kontrakt.Seid = '2')", conn);

       DataTable tb = new DataTable();

       adp.Fill(tb);

       RD.Load(Server.MapPath("CrystalReport.rpt"));

       CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument;
       myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
       myReportDocument.Load(Server.MapPath("CrystalReport.rpt"));
       myReportDocument.SetDatabaseLogon("test","test");
       crv1.ReportSource = myReportDocument;
       crv1.DataBind();
       RD.SetDataSource(tb);
       crv1.ReportSource = RD;
       crv1.DataBind();
       crv1.RefreshReport();

 

i alrady added to the project a dataset file (DataSet1.xsd) and containes 4 tables from sqlserver 2008 tables are (kund2, kontrakt, Produktyper, Bokningar).

so, am using the sql query to get the data from the sqlserver2008 and get the data to the report, but what am getting a screen asking some information to logon as below :

The report you requested requires further information.

  DataSet1
Server name:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset" value=Set1>
Database name:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset">
User name:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset">
Password:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset" =>
< style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none" value=on => Use Integrated Security 
  < style="BORDER-BOTTOM-STYLE: outset; BORDER-RIGHT-STYLE: outset; BORDER-TOP-STYLE: outset; BORDER-LEFT-STYLE: outset" value="Log On" =>
DataSet1
Server name:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset" value=Set1>
Database name:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset">
User name:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset">
Password:  < style="BORDER-BOTTOM-STYLE: inset; BORDER-RIGHT-STYLE: inset; WIDTH: 200px; BORDER-TOP-STYLE: inset; BORDER-LEFT-STYLE: inset" =>
< style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none" value=on => Use Integrated Security 
  < style="BORDER-BOTTOM-STYLE: outset; BORDER-RIGHT-STYLE: outset; BORDER-TOP-STYLE: outset; BORDER-LEFT-STYLE: outset" value="Log On" =>
 
      DataSet1
      Server name: DataSet1
      Database name: 
      User name: 
      Password: 
        
          < style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none" value=on => Use Integrated Security 
 
                             Logon
 


i tried many many things to solve that but nothing at all working, even i tried the previous postes but nothing ...

please if some one can help me out ...

thanks in advance ...
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.