⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mxexport.pas

📁 Export dbgrid to other doc
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    Begin
      TempStr := TempStr + S[ X ];
      If S[ X ] = #34 Then TempStr := TempStr + #34;
    End;

    Result := TempStr;
  End;

  If QMarkNeeded Then Result := '"' + Result + '"' Else
    If ( Pos( #32, Result ) <> 0 ) Or ( Pos( #44, Result ) <> 0 ) Then Result := '"' + Result + '"';
End;

// *************************************************************************************
// ** GenerateStr, 5/17/01 1:21:39 PM
// *************************************************************************************

Function GenerateStr( C: Char; Length: Integer ): String;
Var
  I: Integer;
Begin
  Result := '';
  For I := 1 To Length Do Result := Result + C;
End;

// *************************************************************************************
// ** PadRight, 6/8/01 1:02:00 PM
// *************************************************************************************

Function PadRight( Const S: String; C: Char; N: Integer ): String;
Var
  I: Integer;
Begin
  Result := S;
  If Length( S ) < N Then For I := Length( S ) To N - 1 Do Result := C + Result;
End;

// *************************************************************************************
// ** PadLeft, 5/28/01 11:05:44 AM
// *************************************************************************************

Function PadLeft( Const S: String; C: Char; N: Integer ): String;
Var
  I: Integer;
Begin
  Result := S;
  If Length( S ) < N Then For I := Length( S ) To N - 1 Do Result := Result + C;
End;

// *************************************************************************************
// ** PadCenter, 6/8/01 1:02:09 PM
// *************************************************************************************

Function PadCenter( Const S: String; C: Char; N: Integer ): String;
Begin
  If Length( S ) < N Then
  Begin
    Result := PadLeft( S, ' ', ( N Div 2 ) - ( Length( S ) Div 2 ) );
    Result := PadRight( Result, ' ', N - Length( Result ) );
  End
  Else Result := S;
End;

// *************************************************************************************
// ** Truncate, 5/17/01 5:14:24 PM
// *************************************************************************************

Function Truncate( S: String; Len: Integer; TruncateSymbol: String ): String;
Begin
  If Length( S ) > Len Then
    Result := Copy( S, 1, Len - Length( TruncateSymbol ) ) + TruncateSymbol Else
    Result := S;
End;

// *************************************************************************************
// *************************************************************************************
// *************************************************************************************
// ** TmxExportCellFormat.Create, 05/02/02 4:25:26 PM
// *************************************************************************************
// *************************************************************************************
// *************************************************************************************

{$IFNDEF NATIVEEXCEL_STANDARD}

Constructor TmxExportCellFormat.Create;
Begin
  Inherited Create;

  FFont := TmxExcelFont.Create;

  FBorders := TmxExcelBorders.Create;
  FFormat := cfGeneral;
  FAlignment := TmxExcelAlignment.Create;
  FOptions := [ foLocked ];

  FPattern := TmxExcelPattern.Create;
End;

Destructor TmxExportCellFormat.Destroy;
Begin
  FPattern.Free;
  FBorders.Free;
  FFont.Free;
  FAlignment.Free;
  Inherited Destroy;
End;

Procedure TmxExportCellFormat.SetFont( AValue: TmxExcelFont );
Begin
  FFont.Assign( AValue );
End;

Procedure TmxExportCellFormat.AssignTo( Dest: TPersistent );
Begin
  If Dest Is TmxExportCellFormat Then
  Begin
    With TmxExportCellFormat( Dest ) Do
    Begin
      Alignment.Assign( Self.Alignment );
      Borders.Assign( Self.Borders );
      CustomFormat := Self.CustomFormat;
      Font.Assign( Self.Font );
      Format := Self.Format;
      Options := Self.Options;
      Pattern.Assign( Self.Pattern );
    End
  End Else
    If Dest Is TmxFormat Then
    Begin
      With TmxFormat( Dest ) Do
      Begin
        Alignment.Assign( Self.Alignment );
        Borders.Assign( Self.Borders );
        CustomFormat := Self.CustomFormat;
        Font.Assign( Self.Font );
        Format := Self.Format;
        Options := Self.Options;
        Pattern.Assign( Self.Pattern );
      End
    End Else
      Inherited AssignTo( Dest );
End;

{$ENDIF}

// *************************************************************************************
// *************************************************************************************
// *************************************************************************************
// ** TmxDocumentFilter.Create, 5/30/01 4:25:26 PM
// *************************************************************************************
// *************************************************************************************
// *************************************************************************************

Constructor TmxDocumentFilter.Create;
Begin
  Inherited Create;

  FHTML := rsFilterHTML;
  FExcel := rsFilterExcel;
  FWord := rsFilterWord;
  FText := rsFilterText;
  FComma := rsFilterComma;
  FTab := rsFilterTab;
  FRTF := rsFilterRTF;
  FDIF := rsFilterDIF;
  FSYLK := rsFilterSYLK;
End;

// *************************************************************************************
// *************************************************************************************
// *************************************************************************************
// ** TmxHTMLColors.Create, 5/30/01 11:03:46 AM
// *************************************************************************************
// *************************************************************************************
// *************************************************************************************

Constructor TmxHTMLColors.Create;
Begin
  Inherited Create;

  FDefaultFontFace := rsDefaultFontFace;
  FTableFontFace := rsDefaultFontFace;

  FBackground := StringToColor( rsStandard_BGCOLOR );
  FDefaultLink := StringToColor( rsStandard_LINK );
  FVisitedLink := StringToColor( rsStandard_VLINK );
  FActiveLink := StringToColor( rsStandard_ALINK );
  FDefaultText := StringToColor( rsStandard_TEXT );
  FTableFontColor := StringToColor( rsStandard_TABLE_FONT_COLOR );
  FTableBackground := StringToColor( rsStandard_TABLE_BGCOLOR );
  FTableOddBackground := StringToColor( rsStandard_TABLE_ODD_BGCOLOR );
  FHeaderBackground := StringToColor( rsStandard_HEAD_BGCOLOR );
  FHeadersFontColor := StringToColor( rsStandard_HEAD_FONT_COLOR );
End;

// *************************************************************************************
// ** TmxHTMLColors.AssignTo, 5/30/01 11:04:03 AM
// *************************************************************************************

Procedure TmxHTMLColors.AssignTo( Dest: TPersistent );
Begin
  If Dest Is TmxHTMLColors Then
    With TmxHTMLColors( Dest ) Do
    Begin
      FBackground := Self.Background;
      FDefaultLink := Self.DefaultLink;
      FDefaultFontFace := Self.DefaultFontFace;
      FVisitedLink := Self.VisitedLink;
      FActiveLink := Self.ActiveLink;
      FDefaultText := Self.DefaultText;
      FTableFontColor := Self.TableFontColor;
      FTableFontFace := Self.TableFontFace;
      FTableBackground := Self.TableBackground;
      FTableOddBackground := Self.TableOddBackground;
      FHeaderBackground := Self.HeaderBackground;
      FHeadersFontColor := Self.HeadersFontColor;
    End
  Else Inherited AssignTo( Dest );
End;

// *************************************************************************************
// ** TmxRTFColors.Create, 6/5/01 10:41:28 AM
// *************************************************************************************

Constructor TmxRTFColors.Create;
Begin
  Inherited Create;

  FTableBackground := StringToColor( rsStandard_TABLE_BGCOLOR );
  FTableOddBackground := StringToColor( rsStandard_TABLE_ODD_BGCOLOR );
  FHeaderBackground := StringToColor( rsStandard_HEAD_BGCOLOR );

  FDefaultFont := TFont.Create;

  FHeaderFont := TFont.Create;
  FHeaderFont.Style := [ fsBold ];

  FTableFont := TFont.Create;
End;

// *************************************************************************************
// ** TmxRTFColors.Destroy, 6/5/01 10:43:53 AM
// *************************************************************************************

Destructor TmxRTFColors.Destroy;
Begin
  FDefaultFont.Free;
  FHeaderFont.Free;
  FTableFont.Free;

  Inherited Destroy;
End;

// *************************************************************************************
// ** TmxRTFColors.AssignTo, 6/5/01 10:41:48 AM
// *************************************************************************************

Procedure TmxRTFColors.AssignTo( Dest: TPersistent );
Begin
  If Dest Is TmxRTFColors Then
    With TmxRTFColors( Dest ) Do
    Begin
      FTableBackground := Self.TableBackground;
      FTableOddBackground := Self.TableOddBackground;
      FHeaderBackground := Self.HeaderBackground;

      FDefaultFont.Assign( Self.DefaultFont );
      FHeaderFont.Assign( Self.HeaderFont );
      FTableFont.Assign( Self.TableFont );
    End
  Else Inherited AssignTo( Dest );
End;

// *************************************************************************************
// ** TmxRTFColors.SetDefaultFont, 6/5/01 10:42:10 AM
// *************************************************************************************

Procedure TmxRTFColors.SetDefaultFont( AValue: TFont );
Begin
  FDefaultFont.Assign( AValue );
End;

// *************************************************************************************
// ** TmxRTFColors.SetHeaderFont, 6/5/01 10:42:07 AM
// *************************************************************************************

Procedure TmxRTFColors.SetHeaderFont( AValue: TFont );
Begin
  FHeaderFont.Assign( AValue );
End;

// *************************************************************************************
// ** TmxRTFColors.SetTableFont, 6/5/01 10:42:04 AM
// *************************************************************************************

Procedure TmxRTFColors.SetTableFont( AValue: TFont );
Begin
  FTableFont.Assign( AValue );
End;

// *************************************************************************************
// *************************************************************************************
// *************************************************************************************
// ** TmxHTMLOptions.Create, 5/17/01 10:38:36 AM
// *************************************************************************************
// *************************************************************************************
// *************************************************************************************

Constructor TmxHTMLOptions.Create;
Begin
  Inherited Create;

  FOptions := [ hoShowGridLines, hoBoldHeaders, hoAutoLink, hoOddRowColoring, hoDisplayTitle ];
  FExtension := exHTML;
  FCustomColors := TmxHTMLColors.Create;
  FTemplate := ctStandard;
  FTitle := '';
End;

// *************************************************************************************
// ** TmxHTMLOptions.Destroy, 5/30/01 11:01:05 AM
// *************************************************************************************

Destructor TmxHTMLOptions.Destroy;
Begin
  FCustomColors.Free;
  Inherited Destroy;
End;

// *************************************************************************************
// ** TmxHTMLOptions.SetCustomColors, 5/17/01 10:38:42 AM
// *************************************************************************************

Procedure TmxHTMLOptions.SetCustomColors( AValue: TmxHTMLColors );
Begin
  FCustomColors.Assign( AValue );
End;

// *************************************************************************************
// ** TmxRTFOptions.Create, 5/31/01 1:57:48 PM
// *************************************************************************************

Constructor TmxRTFOptions.Create;
Begin
  Inherited Create;

  FOptions := [ roShowGridLines, roOddRowColoring ];

  FTemplate := rtStandard;
  FCustomSettings := TmxRTFColors.Create;
  FCellWidth := 1400;

  FTopMargin := 101;
  FBottomMargin := 101;
  FLeftMargin := 461;
  FRightMargin := 562;
End;

// *************************************************************************************
// ** TmxRTFOptions.Destroy, 5/31/01 1:58:01 PM
// *************************************************************************************

Destructor TmxRTFOptions.Destroy;
Begin
  FCustomSettings.Free;
  Inherited Destroy;
End;

// *************************************************************************************
// ** TmxRTFOptions.SetCustomSettings, 6/5/01 10:51:45 AM
// *************************************************************************************

Procedure TmxRTFOptions.SetCustomSettings( AValue: TmxRTFColors );
Begin
  FCustomSettings.AssignTo( AValue );
End;

// *************************************************************************************
// ** TmxExcelOptions.Create, 6/7/01 4:11:21 PM
// *************************************************************************************

Constructor TmxExcelOptions.Create;
Begin
  Inherited Create;

  FColumnWidth := 20;
  FProtected := FALSE;

{$IFDEF NATIVEEXCEL_STANDARD}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -