Solved

How do i place more than one chart in crystal reports using xsd

Posted on 2009-04-13
6
312 Views
Last Modified: 2012-06-22
I have created a crystal report with 2 charts. For this i have pulled data from xsd file which contains two datatables. Those two charts get filled with these two tables.

My problem is when i run the report these two charts getting linked and data is changing in the charts depending upon link.

I am getting data from datatables correctly. But when shown in charts they are changing.? Can any one give solution.
MySqlConnection sqlConn = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLConnectionstring"].ToString());

                MySqlCommand comd;

                comd = new MySqlCommand();

                comd.Connection = sqlConn;

                comd.CommandType = CommandType.StoredProcedure;

                comd.CommandText = "usp_AreaByWeek";
 

                comd.Parameters.Add("?ProjID", MySqlDbType.Int32);

                comd.Parameters.Add("?inputDate", MySqlDbType.Datetime.ToString());

                comd.Parameters[0].Value = Convert.ToInt32(ddlProjTitle.SelectedItem.Value);

                comd.Parameters[1].Value = DateTime.Parse(txtStartDate.Text).ToString("yyyy-MM-dd");

if (ds.Tables[2].Rows.Count > 0 || ds.Tables[3].Rows.Count > 0)

                        {

                            myreport.Load(Server.MapPath("Reports\\SampleAreaByWeek.rpt"));

                            myreport.Database.Tables[0].SetDataSource(ds.Tables[3]);

                            myreport.Database.Tables[1].SetDataSource(ds.Tables[2]);
 
 

                            CrystalReportViewer1.Visible = true;                           

                            CrystalReportViewer1.ReportSource = myreport;

                                                   }

Open in new window

0
Comment
Question by:apramod
  • 3
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24133784
Where do you assign DS1 and DS2?

Are you using 2 data sourcesw for the report?
In general this is not supported by Crystal.
You probably need to put one in a subreport.

Are the charts in the same section?

mlmcc
0
 

Author Comment

by:apramod
ID: 24134980
I am pulling the data from two stored procedures into a xsd file.
I missed the two lines of code there where i initialize the dataset ds.
From xsd file i have taken two tables(one for each stored proc) and passing it to crystal report.

I am using only one datasource.
As i said when you place two charts they are getting linked either by two common column text or value, so even if you use subreport then also they will be linked? If they are linked data changes.

0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24144385
If you use a subreport you can use different data sources say 2 XSD files thus there is no link between them.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24663452
I believe the answer of using subreports is the way you need to go.  In each subreport you select 1 table so there is no link made between the tables.

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Combine and display field 5 73
String to Date Formula Failure 2 44
Help with a Crystal Report Formula 8 43
Crystal 11 Suppress main report section if subreport is blank 24 88
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now