13 Replies - 65236 Views - Last Post: 10 May 2010 - 12:49 AM Rate Topic: -----

#1 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

How to display records from multiple Tables using Crystal Report in a

Post icon  Posted 08 April 2008 - 03:04 AM

[font=System]hi,


i want to use crystal reports for displaying records from multiple tables in asp.net 2.0, i know how to display records using dataset in with crystal reports.
Can anybody tell me hoe i will display records on crystal report from multiple Tables.

More Than Two. etc.

Its Urgent , pls help me

Thanks,
Kamlakar
Is This A Good Question/Topic? 0
  • +

Replies To: How to display records from multiple Tables using Crystal Report in a

#2 JasonMcAuley  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 144
  • Joined: 10-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 10 April 2008 - 07:42 AM

With SQL Server; I simply just call my stored procedures in Crystal Reports. With the stored procedures you can write queries that grab data from multiple tables.

Hope this helps! If you have any other questions just ask.
Was This Post Helpful? 0
  • +
  • -

#3 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 11 April 2008 - 12:55 AM

View PostJasonMcAuley, on 10 Apr, 2008 - 07:42 AM, said:

With SQL Server; I simply just call my stored procedures in Crystal Reports. With the stored procedures you can write queries that grab data from multiple tables.

Hope this helps! If you have any other questions just ask.



Hi,
Thank fro reply.
Can u tel me how to write sql statements in Stored Procedure in SQL 2000.
Can u send me the code sample, how u wrote the code for displaying records from multiple tables using SP.

Tel me the Procedure.

Its Urgent , Help Me !!!

Bye,
Kamlesh
Was This Post Helpful? 0
  • +
  • -

#4 JasonMcAuley  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 144
  • Joined: 10-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 11 April 2008 - 07:37 AM

 

CREATE PROCEDURE My_Stored_Procedure AS

Select a.UserID, a.UserName,  b.User_FontColour
From [Users] a
Inner Join User_preference b on a.UserID = b.UserID

GO





That is a simple stored procedure that will select the userID and UserName from the Users table and will select the User_FontColour from the User_preference table


You would do this in your SQL Server Enterprise manager. Open your database, right click on the stored procedures folder click "Create new stored procedure" and write your query.

When you are in crystal reports; you can then make reference to that stored procedure and it will automatically add the fields in your select statement as fields you can place on the report.


Hope that helps

This post has been edited by JasonMcAuley: 11 April 2008 - 07:45 AM

Was This Post Helpful? 0
  • +
  • -

#5 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 14 April 2008 - 09:51 PM

View PostJasonMcAuley, on 11 Apr, 2008 - 07:37 AM, said:

 

CREATE PROCEDURE My_Stored_Procedure AS

Select a.UserID, a.UserName,  b.User_FontColour
From [Users] a
Inner Join User_preference b on a.UserID = b.UserID

GO





That is a simple stored procedure that will select the userID and UserName from the Users table and will select the User_FontColour from the User_preference table


You would do this in your SQL Server Enterprise manager. Open your database, right click on the stored procedures folder click "Create new stored procedure" and write your query.

When you are in crystal reports; you can then make reference to that stored procedure and it will automatically add the fields in your select statement as fields you can place on the report.


Hope that helps

Was This Post Helpful? 0
  • +
  • -

#6 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 14 April 2008 - 09:59 PM

Hi,

Can u send the code for Crystal Report retriving records from multiple Tables using Asp.net2.0 with C# ,Its Urgent.

Can u also send the Design of Crystal Report for selecting records from multiple Tables. My Query work in Query Analyzer but in code it onlt returns all records from Tables.

Can u show me the code exactly how to fetch the Records from multiple Tables send me the code.Help me plsssssss, Its Urgent.

Thanks,
Kamlesh.
Was This Post Helpful? 0
  • +
  • -

#7 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 17 April 2008 - 05:42 AM

View Postkamlesh, on 14 Apr, 2008 - 09:51 PM, said:

View PostJasonMcAuley, on 11 Apr, 2008 - 07:37 AM, said:

 

CREATE PROCEDURE My_Stored_Procedure AS

Select a.UserID, a.UserName,  b.User_FontColour
From [Users] a
Inner Join User_preference b on a.UserID = b.UserID

GO





That is a simple stored procedure that will select the userID and UserName from the Users table and will select the User_FontColour from the User_preference table


You would do this in your SQL Server Enterprise manager. Open your database, right click on the stored procedures folder click "Create new stored procedure" and write your query.

When you are in crystal reports; you can then make reference to that stored procedure and it will automatically add the fields in your select statement as fields you can place on the report.


Hope that helps



Hi,
Thanks for Reply can u send me some code sample with Crystal Reports showing selected record from multiple Tables using C#.net and ASP.net 2.0 .

Send me pls , Its Urgent.
Bye.
Was This Post Helpful? 0
  • +
  • -

#8 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: How to display records from multiple Tables using Crystal Report in a

Posted 17 April 2008 - 09:15 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#9 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 17 April 2008 - 11:34 PM

View Postjayman9, on 17 Apr, 2008 - 09:15 AM, said:

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.



Thanks Buddy,
Here is the code i m posting , but remember that when i am retriving records from two, three or more tables it is returing all records when we bind to crystal Reports.

//see The code .

Plssssssssssss Help me out. I m new to Crystal Reports.
//*********************************************************//

SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
    DataSet ds;
     protected void Page_Load(object sender, EventArgs e)
    {
        ds = new DataSet();
        ds= (DataSet)Session["data"];
       


        //da = new SqlDataAdapter("select* From salesummary", con);
        //ds = new DataSet();
        //da.Fill(ds);
        CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument;
        myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

        //myReportdocument.Load(@"C:\Documents and Settings\Administrator\Desktop\MaitreeGiftShop _New\CrystalReport.rpt");

               
      //  // any of these three methods should work to fill the document
      //  // 
      //// myReportdocument.Database.Tables[0].SetDataSource(ds);
     myReportdocument.Database.Tables[0].SetDataSource(ds);
              
    // myReportdocument.SetDataSource(ds.Tables[0].ToString());

     CrystalReportViewer1.ReportSource = myReportDocument;
         // CrystalReportViewer1.Zoom(1);
     CrystalReportViewer1.DataBind();



     //myReportdocument.Database.Tables["preview"].SetDataSource(myDS);
     ////myReportdocument.Database.Tables[0].SetDataSource(myDS);
     ////myReportdocument.SetDataSource(myDS);

     //CrystalReportViewer1.ReportSource = myReportDocument;
     //CrystalReportViewer1.DataBind();
       }


//********************************************************//



Plsssssssss Help me ?
Bye,
Kamlakar.

EDIT: Code tags added

This post has been edited by PsychoCoder: 18 April 2008 - 12:33 AM

Was This Post Helpful? 0
  • +
  • -

#10 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 21 April 2008 - 09:43 PM

View Postkamlesh, on 17 Apr, 2008 - 11:34 PM, said:

View Postjayman9, on 17 Apr, 2008 - 09:15 AM, said:

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.



Thanks Buddy,
Here is the code i m posting , but remember that when i am retriving records from two, three or more tables it is returing all records when we bind to crystal Reports.

//see The code .

Plssssssssssss Help me out. I m new to Crystal Reports.
//*********************************************************//

SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
    DataSet ds;
     protected void Page_Load(object sender, EventArgs e)
    {
        ds = new DataSet();
        ds= (DataSet)Session["data"];
       


        //da = new SqlDataAdapter("select* From salesummary", con);
        //ds = new DataSet();
        //da.Fill(ds);
        CrystalDecisions.CrystalReports.Engine.ReportDocument myReportDocument;
        myReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

        //myReportdocument.Load(@"C:\Documents and Settings\Administrator\Desktop\MaitreeGiftShop _New\CrystalReport.rpt");

               
      //  // any of these three methods should work to fill the document
      //  // 
      //// myReportdocument.Database.Tables[0].SetDataSource(ds);
     myReportdocument.Database.Tables[0].SetDataSource(ds);
              
    // myReportdocument.SetDataSource(ds.Tables[0].ToString());

     CrystalReportViewer1.ReportSource = myReportDocument;
         // CrystalReportViewer1.Zoom(1);
     CrystalReportViewer1.DataBind();



     //myReportdocument.Database.Tables["preview"].SetDataSource(myDS);
     ////myReportdocument.Database.Tables[0].SetDataSource(myDS);
     ////myReportdocument.SetDataSource(myDS);

     //CrystalReportViewer1.ReportSource = myReportDocument;
     //CrystalReportViewer1.DataBind();
       }


//********************************************************//



Plsssssssss Help me ?
Bye,
Kamlakar.

EDIT: Code tags added





Hi,
Thanks for ur reply.

But paste only that code u have changed i m not getting all.
I need to fetch only those records i have selected with condition not all records from database.

Pls send reply asap.
Thanks,
Kamlakar.
Was This Post Helpful? 0
  • +
  • -

#11 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 03 May 2008 - 05:18 AM

Hi,

I am developing a asp.net application with C#.
I have one dropdownlist with 10 nos. I have one button when i select 1,2,3 ......etc from dropdownlist and click on button then dynamically one dropdownlist ,ont Textbox and one Button will generate.

My Question is that when i add some Int or String value to text (dynamically created) Then the value should be bind to Dropdownlist on Button click(Dynamically Created).

Can anybody tell me how to do this?

Its very Very Urgent.


I am posting the code here.

private void AddMajor()
{
int MajCount = int.Parse(DropDown_Major.SelectedValue);
for (int i = 0; i < MajCount; i++)
{

DropDownList dl1 = new DropDownList();
dl1.ID = "Appt2" + i.ToString();
dl1.Width = Unit.Pixel(104);
TextBox T1 = new TextBox();
T1.ID = "Majadd" + i.ToString();
T1.Width = Unit.Pixel(100);
Button b1 = new Button();
b1.ID = "btnMaj" + i.ToString();
b1.Width = Unit.Pixel(100);
b1.Text = "MajAdd";

// PopulateCourses(dl1, dl2);
//dl = (DropDownList)PlaceHolder_Courses.FindControl("dl1");
//Response.Write(dl.SelectedItem.Text);
PlaceHolder_Major.Controls.Add(dl1);
PlaceHolder_Major.Controls.Add(new LiteralControl(" "));
PlaceHolder_Major.Controls.Add(T1);
PlaceHolder_Major.Controls.Add(new LiteralControl(" "));

PlaceHolder_Major.Controls.Add(b1);
PlaceHolder_Major.Controls.Add(new LiteralControl(" "));




}
}


Please tell me how to Bind value to Dropdown when i will enter some string in Textbox(Dynamically Created) click on Button (Dynamically Created) .

Pls Tell me Its Very Very Urgent?

Thanks,
Kamlesh
Was This Post Helpful? 0
  • +
  • -

#12 kamlesh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-April 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 04 May 2008 - 09:23 PM

Hi,

I am developing a asp.net application with C#.
I have one dropdownlist with 10 nos. I have one button when i select 1,2,3 ......etc from dropdownlist and click on button then dynamically one dropdownlist ,ont Textbox and one Button will generate.

My Question is that when i add some Int or String value to text (dynamically created) Then the value should be bind to Dropdownlist on Button click(Dynamically Created).

Can anybody tell me how to do this?

Its very Very Urgent.


I am posting the code here.

private void AddMajor()
{
int MajCount = int.Parse(DropDown_Major.SelectedValue);
for (int i = 0; i < MajCount; i++)
{

DropDownList dl1 = new DropDownList();
dl1.ID = "Appt2" + i.ToString();
dl1.Width = Unit.Pixel(104);
TextBox T1 = new TextBox();
T1.ID = "Majadd" + i.ToString();
T1.Width = Unit.Pixel(100);
Button b1 = new Button();
b1.ID = "btnMaj" + i.ToString();
b1.Width = Unit.Pixel(100);
b1.Text = "MajAdd";

// PopulateCourses(dl1, dl2);
//dl = (DropDownList)PlaceHolder_Courses.FindControl("dl1");
//Response.Write(dl.SelectedItem.Text);
PlaceHolder_Major.Controls.Add(dl1);
PlaceHolder_Major.Controls.Add(new LiteralControl(" "));
PlaceHolder_Major.Controls.Add(T1);
PlaceHolder_Major.Controls.Add(new LiteralControl(" "));

PlaceHolder_Major.Controls.Add(b1);
PlaceHolder_Major.Controls.Add(new LiteralControl(" "));




}
}


Please tell me how to Bind value to Dropdown when i will enter some string in Textbox(Dynamically Created) click on Button (Dynamically Created) .

Pls Tell me Its Very Very Urgent?

Thanks,
Kamlesh
[/quote]
Was This Post Helpful? 0
  • +
  • -

#13 gever  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 29
  • Joined: 19-June 08

Re: How to display records from multiple Tables using Crystal Report in a

Posted 16 December 2008 - 04:10 AM

here you check crystal reports from multiple tables.

http://vb.net-inform...iple_tables.htm

thanks.
Was This Post Helpful? 0
  • +
  • -

#14 Guest_ARVIND KUMAR*


Reputation:

Re: How to display records from multiple Tables using Crystal Report in a

Posted 10 May 2010 - 12:49 AM

GOOD MORNING SIR;
I HAVE A PROBLEM THAT I HAVE TO SHOW .XSD FILES IN ASP.NET BY DROP DOWN LIST IN CRYSTAL REPORT VIEWER. SO PLZ HELP ME ITS VERY URGENT FOR MY JOB.
PLZ PLZ ... HELP ME.
:- KUMAR
Was This Post Helpful? 0

Page 1 of 1