Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. URGENT: PROBLEM IN CRYTAL REPORTS OUTPUT

URGENT: PROBLEM IN CRYTAL REPORTS OUTPUT

Scheduled Pinned Locked Moved Visual Studio
csharpdatabasehelpasp-netsql-server
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mavii
    wrote on last edited by
    #1

    have designed crystal reports in my project in VISUAL STUDIO.net 2005 in ASP.net, C#. i have designed database in SQL Server 2005.in crystal report i have used the SQL Query which takes records from two tables, but in output the record against the column of one table re repeating.i am also displaying my code behind crystalReportViewer1_Load as i am struggling for many days but couldnt find error, please help me find any solution.i have generated reports through crystal report wizard private void crystalReportViewer1_Load(object sender, EventArgs e) { //string strcon = "Provider=SQLOLEDB;Server=./SQLEXPRESS;DataSource=rescue15; User Instance=false; Integrated Security=true;"; string strcon = "Provider=SQLOLEDB;Server=(local);Database=rescue15;uid=sa;pwd=SASA;"; OleDbConnection conn = new OleDbConnection(strcon); //string q = "SELECT DISTINCT crime_mgmt.cr_location,crime_mgmt.cr_date,offensive_issue.c_desc FROM crime_mgmt,offensive_issue WHERE crime_mgmt.fir_num = offensive_issue.fir_num AND crime_mgmt.cr_date BETWEEN '" + crimewithdate.text + "' AND '" + crimewithdate.text1 + "'"; string q = "SELECT c.cr_date, c.cr_location, o.c_desc FROM crime_mgmt AS c INNER JOIN offensive_issue AS o ON c.fir_num = o.fir_num WHERE c.cr_date BETWEEN '" + crimewithdate.text.ToString() + "' AND '" + crimewithdate.text1.ToString() + "'"; OleDbCommand cmd = new OleDbCommand(q, conn); conn.Open(); ReportDocument rep = new ReportDocument(); string exename = Application.ExecutablePath; FileInfo exefile = new FileInfo(exename); string directory = exefile.DirectoryName; string str = HostingEnvironment.ApplicationPhysicalPath + directory + "\\CrystalReport2.rpt"; rep.Load(str); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); //da.Fill(ds); da.Fill(ds, "crime_mgmt"); da.Fill(ds, "offensive_issue"); //ds.WriteXml(directory + "\\AuthoritesWise.xml"); //ds.ReadXml(directory + "\\AuthoritesWise.xml"); rep.SetDataSource(ds); crystalReportViewer1.ReportSource = rep; conn.Close(); }

    P P 2 Replies Last reply
    0
    • M mavii

      have designed crystal reports in my project in VISUAL STUDIO.net 2005 in ASP.net, C#. i have designed database in SQL Server 2005.in crystal report i have used the SQL Query which takes records from two tables, but in output the record against the column of one table re repeating.i am also displaying my code behind crystalReportViewer1_Load as i am struggling for many days but couldnt find error, please help me find any solution.i have generated reports through crystal report wizard private void crystalReportViewer1_Load(object sender, EventArgs e) { //string strcon = "Provider=SQLOLEDB;Server=./SQLEXPRESS;DataSource=rescue15; User Instance=false; Integrated Security=true;"; string strcon = "Provider=SQLOLEDB;Server=(local);Database=rescue15;uid=sa;pwd=SASA;"; OleDbConnection conn = new OleDbConnection(strcon); //string q = "SELECT DISTINCT crime_mgmt.cr_location,crime_mgmt.cr_date,offensive_issue.c_desc FROM crime_mgmt,offensive_issue WHERE crime_mgmt.fir_num = offensive_issue.fir_num AND crime_mgmt.cr_date BETWEEN '" + crimewithdate.text + "' AND '" + crimewithdate.text1 + "'"; string q = "SELECT c.cr_date, c.cr_location, o.c_desc FROM crime_mgmt AS c INNER JOIN offensive_issue AS o ON c.fir_num = o.fir_num WHERE c.cr_date BETWEEN '" + crimewithdate.text.ToString() + "' AND '" + crimewithdate.text1.ToString() + "'"; OleDbCommand cmd = new OleDbCommand(q, conn); conn.Open(); ReportDocument rep = new ReportDocument(); string exename = Application.ExecutablePath; FileInfo exefile = new FileInfo(exename); string directory = exefile.DirectoryName; string str = HostingEnvironment.ApplicationPhysicalPath + directory + "\\CrystalReport2.rpt"; rep.Load(str); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); //da.Fill(ds); da.Fill(ds, "crime_mgmt"); da.Fill(ds, "offensive_issue"); //ds.WriteXml(directory + "\\AuthoritesWise.xml"); //ds.ReadXml(directory + "\\AuthoritesWise.xml"); rep.SetDataSource(ds); crystalReportViewer1.ReportSource = rep; conn.Close(); }

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      First of all, you've posted your message in the wrong forum. This forum is for discussions about Visual Studio itself. Secondly, please don't title your posts 'URGENT'. It's rude. Everyone's post is urgent, but as you're not paying anyone for their help you should be prepared to wait.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      1 Reply Last reply
      0
      • M mavii

        have designed crystal reports in my project in VISUAL STUDIO.net 2005 in ASP.net, C#. i have designed database in SQL Server 2005.in crystal report i have used the SQL Query which takes records from two tables, but in output the record against the column of one table re repeating.i am also displaying my code behind crystalReportViewer1_Load as i am struggling for many days but couldnt find error, please help me find any solution.i have generated reports through crystal report wizard private void crystalReportViewer1_Load(object sender, EventArgs e) { //string strcon = "Provider=SQLOLEDB;Server=./SQLEXPRESS;DataSource=rescue15; User Instance=false; Integrated Security=true;"; string strcon = "Provider=SQLOLEDB;Server=(local);Database=rescue15;uid=sa;pwd=SASA;"; OleDbConnection conn = new OleDbConnection(strcon); //string q = "SELECT DISTINCT crime_mgmt.cr_location,crime_mgmt.cr_date,offensive_issue.c_desc FROM crime_mgmt,offensive_issue WHERE crime_mgmt.fir_num = offensive_issue.fir_num AND crime_mgmt.cr_date BETWEEN '" + crimewithdate.text + "' AND '" + crimewithdate.text1 + "'"; string q = "SELECT c.cr_date, c.cr_location, o.c_desc FROM crime_mgmt AS c INNER JOIN offensive_issue AS o ON c.fir_num = o.fir_num WHERE c.cr_date BETWEEN '" + crimewithdate.text.ToString() + "' AND '" + crimewithdate.text1.ToString() + "'"; OleDbCommand cmd = new OleDbCommand(q, conn); conn.Open(); ReportDocument rep = new ReportDocument(); string exename = Application.ExecutablePath; FileInfo exefile = new FileInfo(exename); string directory = exefile.DirectoryName; string str = HostingEnvironment.ApplicationPhysicalPath + directory + "\\CrystalReport2.rpt"; rep.Load(str); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); //da.Fill(ds); da.Fill(ds, "crime_mgmt"); da.Fill(ds, "offensive_issue"); //ds.WriteXml(directory + "\\AuthoritesWise.xml"); //ds.ReadXml(directory + "\\AuthoritesWise.xml"); rep.SetDataSource(ds); crystalReportViewer1.ReportSource = rep; conn.Close(); }

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        Do not use the word urgent. It is considered rude and is frowned upon here. You are best off asking in the SQL forum on this site or the C# forum. Don't do both or you will get flamed for cross posting :-D

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups