📄 program.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;
using GeneratingMicrosoftWordReports.Reports;
namespace GeneratingMicrosoftWordReports.Transformer
{
/// <summary>
/// Demonstrates usage of GeneratingMicrosoftWordReports.Reports class library
/// </summary>
class Program
{
private static string _outputPath = @"c:\test.doc";
static void Main(string[] args)
{
// Populate report using data and return it as byte array
//byte[] wordDoc = Report.WordGeneratedInvoice();
byte[] wordDoc = Report.WordGeneratedInvoice();
// Write resulting array to HDD, show process information
using (FileStream fs = new FileStream(_outputPath, FileMode.Create))
fs.Write(wordDoc, 0, wordDoc.Length);
Console.WriteLine("Saved to: {0}", _outputPath);
Console.WriteLine("\nPress any key to continue");
Console.ReadKey();
// Display resulting report in Word
Process.Start(new ProcessStartInfo(_outputPath));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -