We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to generate excel report with aspose cells that has dynamic date columns?

As I am new to Aspose as well as oracle , facing trouble in generating excel.I want to generate a excel file from aspose .net. The problem of mine is as follows:

I have a data in coming out from oracle database in the following format:

Supervisor_Name Tel_No  Assigned_Date   Emp_Name    Job Color
Jacob Andrew    121     10/10/2016      Robert      A11 Green
Jacob Andrew    123     10/10/2016      David       A12 Red
John             214    10/10/2016      Kristen     A13 Blue
John           32211    11/10/2016      Garry       B11 Orange
John           55454    11/10/2016      Martin      B32 Blue

For this I have joined multiple tables based on the requirement.

The problem is , I want this data in Excel in the following manner:

                             Mon        Tue
                              10         11
**Supervisor_Name Emp_Name**  
Jacob Andrew      
00121             Robert      A11
00123             David       A12
John              
                  Kristen     A13
                  Garry                  B11
                  Martin                 B32

I am not able to fetch the data in this format from oracle as well, if that would have worked it could have easier my code. But now as i am unable to fetch the data in the manner described above, Please suggest me a way by which i can accomplish this.

I am trying to achieve this in code side but stuck somewhere because of architecture.

public static DataTable ConvertListToDataTable<T>(List<T> sourceList, List<ExcelCol> col)
        {
            DataTable ExDataTable= new DataTable(typeof(T).Name);
            DataRow newRow = null;
            Dictionary<string,List> dictCheck = new Dictionary<string,List>(); // For adding a supervisor and his corresponding records
        </span><span class="kwd">return</span><span class="pln"> </span><span class="typ">ExDataTable</span><span class="pun">;</span><span class="pln">
    </span><span class="pun">}<br><br></span></code>What i am doing is trying to convert the data in data table in the 

format i want. But that doesn’t seems to help me. Please can anyone
suggest me a way/ approach to do this kind of task. Any help from anyone
would be highly appreciated. Regards,


Hi,


Thanks for providing details.

Well, it might be difficult to insert/paste data into MS Excel worksheet in your desired custom oriented format but I think you may try to use Smart Markers feature provided by Aspose.Cells APIs if this could help you to accomplish your task to certain extent. I think you may try to use Grouping Data options of Smart Markers if it could help you, see the document for your reference with examples:
http://www.aspose.com/docs/display/cellsnet/Using+Smart+Markers

Thank you.