Sign In  Sign Up Live-Chat

Smart Marker Question

Last post 01-04-2009, 12:39 AM by Amjad Sahi. 57 replies.
Page 1 of 4 (58 items)   1 2 3 4 Next >
Sort Posts: Previous Next
  •  11-01-2007, 1:25 AM 100863

    Smart Marker Question

    Hi,

    Using Smart Markers, is there a way to have a Summary Row in the middle of the table based on a value?

    For example:

    Col1, col2, col3, col4

    Have a sum based on Col1 values (for each value, have a total of Col2) - grouped by Col1

    Thanks!

     
  •  11-01-2007, 1:52 AM 100866 in reply to 100863

    Re: Smart Marker Question

    Hi,

    Thanks for considering Aspose.

    Well, I think you can manually try to insert summary row (using Cells.InsertRow() method) after processing the markers (after using WorkbookDesigner.Process() method) and apply formula (using Cell.Formula property) to it based on your condition.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  11-01-2007, 2:03 AM 100868 in reply to 100866

    Re: Smart Marker Question

    Hi,

    How would we get summaries to be in between rows that were processed?

    Thanks!

     
  •  11-01-2007, 2:37 AM 100872 in reply to 100868

    Re: Smart Marker Question

    Hi,

    Well, In your newly inserted row(s), you may write code e.g., Cell.Formula = "=SUM()"... if you want to get the formula results at runtime, kindly call Workbook.CalcualteFormula before obtaining the formula calculated values.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  11-01-2007, 12:14 PM 100937 in reply to 100872

    Re: Smart Marker Question

    Hi,

    I think there is a misunderstanding.

    Basically, here is what we want to do:

    We have smart markers on Row 1.

    After designer.process(), it populates 10 rows.

    After row 3, we would like a Sum

    After row 7, we would like a sum

    and a final sum on bottom

    Thanks!

     
  •  11-01-2007, 12:41 PM 100942 in reply to 100937

    Re: Smart Marker Question

    Hi,

    Do you mean you want SUM like running totals or want an extra row inserted and make the sum of the cells. Could you create a sample spreadsheet in MS Excel and post it here with details. We will check and try to implement your requirements.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  11-02-2007, 9:55 AM 101051 in reply to 100942

    Re: Smart Marker Question

    Attachment: Present (inaccessible)

    Hi Amjad,

    Please find a sample attached. The smart tags just have &=Type, &=Desc, &=amount.

    We would like to sum up the individual types as shown in the sample.

    Any suggestions?

    Thanks!

     
  •  11-02-2007, 1:41 PM 101076 in reply to 101051

    Re: Smart Marker Question

    Attachment: Present (inaccessible)

    Hi,

    Thanks for the sample template.

    I don't find any direct way to accomplish this except you have to manually insert new rows at regular data sets of cells and insert the formula for obtaining the SUM of  every set. Actually this is just like a Subtotaling feature.

    I have a similar example for you... Kindly consult it and understand the code below, it will give you some insight and you may build your own solution. Attached is the zip file containing the input and output excel files, so you may them first. The input file "stbook.xls" ...you may take it as a sample file with all the markers processed, so you may start your coding after workbookdesigner.Process() method.

     Here is the code:

    Workbook workbook = new Workbook();
                      workbook.Open("d:\\test\\stbook.xls");
                      Worksheet worksheet = workbook.Worksheets[0];
                      Cells cells = worksheet.Cells;
                      Cell cell,prevcell=null, lastcell;
                      Style style = workbook.Styles[workbook.Styles.Add()];
                      style.Font.IsBold = true;
                      style.Custom = "#,##0";
                      int frow=0;
                      string []arr = {"C0001","C0002","C0003"};
                      string []tcells = new string[3];
                      for(int i = 0;i<arr.Length;i++)
                      {
                            do
                            {
                                  cell = cells.FindString(arr[i],prevcell);
                                  if (frow == 0)
                                  {
                                        //Get strarting cell's row index for obtaining sum for the range set.
                                        frow = cell.Row;
                                  }
                                  if (cell == null)
                                  {
                                        lastcell = prevcell;
                                        int row = lastcell.Row;
                                        cells.InsertRow(row+1);
                                        cells[row+1,0].PutValue("SubTotal");
                                        cells[row+1,0].Style =style;
                                        string fcell = CellsHelper.CellIndexToName(frow,2);
                                        string lcell = CellsHelper.CellIndexToName(row,2);
                                        cells[row+1,2].Formula = "=SUM("+ fcell + ":" + lcell + ")";
                                        cells[row+1,2].Style =style;
                                        //For making grand total at the end, store individual totals to array.
                                        tcells[i] = cells[row+1,2].Name;
                                        frow = 0;
                                        break;
                                  }
                                  prevcell = cell;
                            }while(cell!=null);
                      }

                      int maxrow = cells.MaxDataRow;
                      cells[maxrow+1,0].PutValue("Total");
                      cells[maxrow+1,0].Style = style;
                      cells[maxrow+1,2].Formula = "=" + tcells[0] + "+" + tcells[1] + "+" + tcells[2];
                      cells[maxrow+1,2].Style = style;
                      workbook.Save("d:\\test\\stbook2.xls");

     

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  11-19-2007, 2:35 PM 103127 in reply to 101076

    Re: Smart Marker Question

    Attachment: Present (inaccessible)

    Hi,

    Please find another sample attached - What is the easiest way of grouping information like the attached sample? Will Smart Markers support these types of groupings in future?

    Thanks!

     
  •  11-20-2007, 1:09 AM 103186 in reply to 103127

    Re: Smart Marker Question

    Hi,

    Thank you.

    I think you have to manually do this using Aspose.Cells API like Cell.PutValue() method and I don't find any direct way in MS Excel either. For setting formulas you may use Cell.Formula property.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Nanjing Team
    Contact Us
     
  •  11-20-2007, 11:34 AM 103274 in reply to 103186

    Re: Smart Marker Question

    Hi,

    Will grouping like shown in the sample be implemented soon for Aspose.cells for Smart Markers?

    Thanks!

     
  •  11-22-2007, 9:37 PM 103728 in reply to 103274

    Re: Smart Marker Question

    We will make it in the future version but it won't be available in a short time.


    Laurence Chen
    Chief Architect
    Aspose Nanjing Team
    About Us
    Contact Us
     
  •  11-26-2007, 11:56 AM 103966 in reply to 103728

    Re: Smart Marker Question

    Hi Laurence,

    Do you have an Estimated Time for it? It's a great feature which we are looking forward to :)

    Thanks!

     
  •  11-26-2007, 6:59 PM 103994 in reply to 103966

    Re: Smart Marker Question

    Hopefully it will be available in 2-3 months.
    Laurence Chen
    Chief Architect
    Aspose Nanjing Team
    About Us
    Contact Us
     
  •  12-20-2007, 10:03 AM 106860 in reply to 103994

    Re: Smart Marker Question

    Hi Laurence,

    Do you have a more accurate time estimate on the above now :)? We are anxiously waiting for it.

    Thanks!

     
Page 1 of 4 (58 items)   1 2 3 4 Next >
View as RSS news feed in XML