Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Crystal report showing Multile record Post Reply Post New Topic
Author Message
Santokh singh
Newbie
Newbie
Avatar

Joined: 22 Apr 2010
Location: India
Online Status: Offline
Posts: 2
Quote Santokh singh Replybullet Topic: Crystal report showing Multile record
    Posted: 22 Apr 2010 at 9:08pm
Dear all,
             I have created a report using a stored procedure which expects some parameters i Have passed the required parametes but report is displaying 9 time a single record can any body suggest me wt to do in that case and code for that is like that below:
 
Its too urgent so please reply fast ASAP.

ReportDocument reportDocument = new ReportDocument();

ParameterField paramField = new ParameterField();

ParameterFields paramFields = new ParameterFields();

ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

//ParameterFieldDefinition parmfldDefn;

//Set instances for input parameter 1 - @vDepartment

paramField.Name = "@EndDate";

//parmfldDefn = reportDocument.DataDefinition.ParameterFields[0];

//Below variable can be set to any data present in SalseData table, Department column

paramDiscreteValue.Value = EndDate;

paramField.CurrentValues.Add(paramDiscreteValue);

//Add the paramField to paramFields

paramFields.Add(paramField);

//Set instances for input parameter 2 - @iSalseYear

//*Remember to reconstruct the paramDiscreteValue and paramField objects

paramField = new ParameterField();

paramField.Name = "@Date";

// parmfldDefn = reportDocument.DataDefinition.ParameterFields[1];

paramDiscreteValue = new ParameterDiscreteValue();

paramDiscreteValue.Value =Convert.ToString(Convert.ToDateTime(EndDate).AddDays(10)

.ToString("dd/MM/yyyy hh:mm"));

paramField.CurrentValues.Add(paramDiscreteValue);

//Add the paramField to paramFields

paramFields.Add(paramField);

crystalReportViewer1.ParameterFieldInfo = paramFields;

reportDocument.Load(Path + @"\Tamper Analyzer\Reports\Instantaneous Report.rpt");

//set the database loggon information.

//**Note that the third parameter is the DSN name and not the Database or System name

//reportDocument.SetDatabaseLogon(

//Load the report by setting the report source

crystalReportViewer1.ReportSource = reportDocument;

Thax regs
Santokh singh
Rgds
Santokh Singh
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Apr 2010 at 10:56am
If the stored procedure provides the only data in the report, there are two options that I can think of:
 
1.  In the report, go to the database menu and turn on Select Distinct Data.
 
2.  Modify the stored procedure to return distinct records.
 
However, if the stored procedure already returns disctinct records and is just one of several data sources for the report, you're probably seeing the duplicate records because of the one-to-many relationships with one or more of the other tables in the report that make the actual SQL not return distinct records.  In this case, the best way to handle the situation is to group on a field or combination of fields that identify a distinct record.  Put the data that's now in your details in either Group Header or Group Footer sections.  If you're using any summaries (sum, count, etc.) you'll also have to rework them because they'll be inflated due to the multiple records.
 
-Dell
IP IP Logged
Santokh singh
Newbie
Newbie
Avatar

Joined: 22 Apr 2010
Location: India
Online Status: Offline
Posts: 2
Quote Santokh singh Replybullet Posted: 23 Apr 2010 at 8:11pm
Dear Dell,
               Thanks for you valueable time that you gave to the discussion.
 
Actually stored procedure that i am using has relation between two tables and returning records and thise recordds are already distinct.
may be grouping the field will help  me.
Thax.
               i ll just try it out and tell you that.
Rgds
Santokh Singh
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.027 seconds.