Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Look at this query :
select sp.MaintenceCode, sp.MDate, sp.PDes,sp.SPCode, s.SpareParts, em.EmpName as MaintainedBy, md.MachinaryName, sp.SPMCode from tblDailyMaintenceDetails dm inner join tblEmployeeInformation em on em.EmpCode=dm.EmpCode inner join tblSparePartsMaintenance sp on sp.MaintenceCode=dm.MaintenceCode inner join tblSpareParts s on s.SPCode=sp.SPCode inner join tblMachinaryDetails md on md.MDCode=dm.MDCode where md.MDCode='MDP-000001' and sp.MDate='15-May-2013'

The result of this query is :
MaintenceCode MDate      PDes      SPCode   SpareParts  MaintainedBy   MachinaryName  SPMCode
____________  _____     ____       ______     __________  ___________   ___________  _______
DMC-002	     2013-05-15  bad	   SPC-000002 Cable	   HASNA BEGUM	  Toshiba SPM-000002
DMC-002	     2013-05-15  not good  SPC-000001	Motor	   HASNA BEGUM	  Toshiba SPM-000004

I have to show this query in Crysta report. Here MDate means Maintenance date of a Spare parts. If two spare parts is Maintained in the same date then the two spare parts will be shown in crystal report seperating by a comma. But other columns duplication should be stopped. Please give me a proper solution. I also want to mention that I use ADO.NET to create crystal report.
Posted
Updated 8-May-13 0:30am
v3

1 solution

insert group of you date field in report

now in create 3 formulas
1. Reset_SpareParts //Put in Header-section of Date group //Suppress it
VB
Global StringVar Sp
SP:= '';


2. Merge_SpareParts //Put in Detail section //Suppress it
VB
Global StringVar Sp
SP := SP + ',';


3. Print_SpareParts //Put in Footer-section of Date group
VB
WhilePrintingRecords;
Global StringVar Sp
SP;

Now, drag-drop other Comman fields in Footer-section of Date group
...MaintenceCode, MDate, Print_SpareParts , MaintainedBy, MachinaryName.

Happy Coding!
:)
 
Share this answer
 
Comments
Sumon562 8-May-13 6:28am    
Thanks Aarti Meswania. The three formula that you mentioned how it create and how can I use these formula. Can you explain please?
Aarti Meswania 8-May-13 6:32am    
visit link... http://www.youtube.com/watch?v=G3oCExBCxaQ

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900