function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
arun kumar.ax887arun kumar.ax887 

How to get the report in Matrix Format

Hi All,

 

     I have a requirement where in I have to get the report in matrix format for which I have written a controller and a Visual force page.  I am able to retrieve all the values, but there is alignment problem and column names are appearing repeatedly.  All the values are printed under a single column.  I tried using Group by function,  but it is not working.  I have tried to use Distrinct function, but it is not supported in SOQL. So could any one suggest a solution for this problem.

 

The code for the Controller and Visual force page are written below:

 

 

Controller Class:

 

 

public class Appointment
{
public PageReference save()
{
return null;
}
public Appointment(ApexPages.StandardController controller)
{
}
public  Appointment__c[] App;
public Appointment()
{
 
App=[select id,Name,Appt_Time__c,Appt_Date__c,Branch__r.Name,Doctor__r.Name ,Account__r.Name,Account__r.Phone,
Check_In__c,Check_Out__c,Cancelled__c,New_Request__c,Chiropractic__c,Shockwave__c,DTS__c,
Knee_Brace_Fitting__c,Spine_Cor_Bracing__c,Spine_Cor_Review__c,Physiotherapy__c,
Orthopedic_Consultation__c,Others__c From Appointment__c];
}
public String getname()
{
return 'Appointment';
}
public Appointment__c[] getApp()
{
return App;
}
}

 

 

 

Visual Force Page:

 

 

 

<apex:page controller="Appointment">

<html>

<head>

 

</head>

 

<body>

<table cellpadding="0" cellspacing="0" width="100%" border="1 #000000 solid">

    <th/>

    <apex:repeat value="{!app}" var="a">

 

    <th align="left" valign="top" style="border:1px #000000 solid;height:20px; width : 180px;">

    <font style="font-size: 13px;" color="#000000 " face="Calibri"><b><center><h3> {!a.Doctor__r.Name} </h3></center></b></font><br/></th>

 

 

    </apex:repeat>

 

<apex:repeat value="{!app}" var="a" rendered="true">

<tr>

 

    <td style="border: 1px #000000 solid ;">{!a.Appt_Time__c}</td>

    <td style="border: 1px #000000 solid ;">

    {!a.Account__r.Name}

    <br/>

 

{!IF (a.New_Request__c == true, "New Request",

     (IF(a.Chiropractic__c==true, "Chiropractic",

     (IF(a.Shockwave__c==true, "Shockwave",

     (IF(a.DTS__c==true, "DTS",

     (IF(a.Knee_Brace_Fitting__c==true, "Knee Brace Fitting",

     (IF(a.Spine_Cor_Bracing__c==true, "Spine Cor Bracing",

     (IF(a.Spine_Cor_Review__c==true, "Spine Cor Review",

     (IF(a.Physiotherapy__c==true, "Physiotherapy",

     (IF(a.Orthopedic_Consultation__c==true, "Orthopedic Consultation",

     (IF(a.Others__c==true, "Others",null 

)))))))))))))))))))}

<br/>

{!a.Account__r.Phone}

      <br/>

     {!IF( a.Check_In__c == true, "Check In",

     (IF(a.Check_Out__c==true, "Check Out",

     (IF(a.Cancelled__c==true, "Cancelled",null )))))}

 

    </td>

  </tr> 

   </apex:repeat>

 

</table>

</body>

</html>

</apex:page>

 

 

 

Thanks and Regards

 

Arun