Table 370 and Formula

widywidy Member Posts: 13
Hello!;

There's a report in which users want columns and colors in the excel.
We can easily choose underline, bold etc.... but not colors nor verticale lines for example and sometime it would be really useful to separate cells.
So, is it possible to add them as functions using formula; (or any other way indeed....)
Maybe this is explained somewhere in the forum, so sorry if my question is not a good one.
Thks for your help.
widy.

Comments

  • kitikkitik Member Posts: 230
    You'll have to write some code, but it's really easy.

    1. Create a new integer field in the Excel Buffer table, called Color.
    2. Edit the function CreateSheet from the Excel Buffer table. Add the code below:
    IF Bold THEN
          XlWrkSht.Range(xlColID + xlRowID).Font.Bold := Bold;
       IF Italic THEN
          XlWrkSht.Range(xlColID + xlRowID).Font.Italic := Italic;
       XlWrkSht.Range(xlColID + xlRowID).Borders.LineStyle := XlLineStyleNone;
       IF Underline THEN
          XlWrkSht.Range(xlColID + xlRowID).Borders.Item(XlEdgeBottom).LineStyle := XlContinuous;
       IF Color <> 0 THEN // ADD THIS LINE
          XlWrkSht.Range(xlColID + xlRowID).Interior.ColorIndex := Color; [/b] // ADD THIS LINE
    UNTIL NEXT = 0;
      XlWrkSht.Range(GetExcelReference(5) + ':' + xlColID + xlRowID).Columns.AutoFit;
    

    3. Add the Color paramater to the EnterCell function, and add the line:
    TempExcelBuffer.Underline := UnderLine;
    TempExcelBuffer.Color := Color; // ADD THIS LINE
    TempExcelBuffer.INSERT;
    

    Hope this helps.

    Salut!
    Laura Nicolàs
    Author of the book Implementing Dynamics NAV 2013
    Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.
  • widywidy Member Posts: 13
    Hola!

    Muchisimas Gracias! claro que eso me ayuda mucho! \:D/

    =D> your answer is just great.
    Really, thks so much;; have a great day.
    widy.
Sign In or Register to comment.