Need Date as Left Justification..

JAYESHJAYESH Member Posts: 290
HI.

I export date in to excel file.
When i check the date its showing me in right justification.
I want the date in left justification.

Can any one tell me how to do that.

Thank you
Waiting for your reply
JAYESH PATEL

Comments

  • JAYESHJAYESH Member Posts: 290
    I didnt get this..

    Can you make details with date.

    I want date in left justification.

    Thank you
    JAYESH PATEL
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,499
    Please remove the "[Urgent]" notice in your topic Subject.

    I'm sure anyone in this forum will answer the questions if they know the answer AND if they have the time for it. There is no need to push the forum users to answer your question first.
  • Igor_BeeoneIgor_Beeone Member Posts: 80
    Hello,
    you need to make some modifications on a table 370 (If you're using Excel Buffer for Export) - possible actions:
    1 - add additional field Alignment Type (integer or option - as you wish) to the table Excel Buffer. Init value make 1.
    Possible Options of Excel alignments for cell are (we will use integers):
    1=Default
    2=Left
    3=Center
    4=Right
    2 - modify CreateSheet function in Excel Table (370) by adding
    code line:
    IF FIND('-') THEN BEGIN
      REPEAT
        RecNo := RecNo + 1;
        Window.UPDATE(1,ROUND(RecNo / TotalRecNo * 10000,1));
        IF NumberFormat <> '' THEN
          XlWrkSht.Range(xlColID + xlRowID).NumberFormat := NumberFormat;
        IF Formula = '' THEN
          XlWrkSht.Range(xlColID + xlRowID).Value := "Cell Value as Text"
        ELSE
          XlWrkSht.Range(xlColID + xlRowID).Formula := GetFormula;
        IF Comment <> '' THEN
          XlWrkSht.Range(xlColID + xlRowID).AddComment := Comment;
        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;
       //>>This code must be added
        If "Alignment Type">1 THEN
          XlWrkSht.Range(xlColID + xlRowID).HorizontalAlignment := "Alignment Type";
       //<<
        IF Underline THEN
          XlWrkSht.Range(xlColID + xlRowID).Borders.Item(XlEdgeBottom).LineStyle := XlContinuous;
      UNTIL NEXT = 0;
      XlWrkSht.Range(GetExcelReference(5) + ':' + xlColID + xlRowID).Columns.AutoFit;
    END;
    
    And now while creating filling Excel Buffer table before exporting define for proper fields Allignment Type value, or skip to use default.
    Example Objects:

    http://igor.beeone.googlepages.com/Example.zip
    ---
    If You're making manual export w/o 370 table Excel Buffer then follow the link Savatage provided above.


    Br,
    Igor Beeone
  • JAYESHJAYESH Member Posts: 290
    Thanks for the Information.
    JAYESH PATEL
Sign In or Register to comment.