C# 根据流程创建PDF报告
我在比较两张表。我将获得在另一个表中找不到的行,并计算所有可能的行数。 这些信息应该在一个具有良好概述的文件中报告。 我从文件里读表格!类似于CSV,但它们是文本文件 我的桌子类:C# 根据流程创建PDF报告,c#,compare,C#,Compare,我在比较两张表。我将获得在另一个表中找不到的行,并计算所有可能的行数。 这些信息应该在一个具有良好概述的文件中报告。 我从文件里读表格!类似于CSV,但它们是文本文件 我的桌子类: class TableModel { private string tableName; private string[] headers; private string[] keys; public int HeaderCount { get; set; } pub
class TableModel {
private string tableName;
private string[] headers;
private string[] keys;
public int HeaderCount { get; set; }
public int RowCount { get; set; }
public string TableName { get { return tableName; } set { this.tableName = value; } }
public string[] Headers { get { return headers; } set { this.headers = value; } }
public string[] Keys { get { return keys; } set { this.keys = value; } }
}
我的桌面加载器:
class TableLoader {
public TableModel LoadTable(string path) {
TableModel model = new TableModel();
FileStream filestream = new FileStream(path, FileMode.Open, FileAccess.Read);
using(StreamReader reader = new StreamReader(filestream, Encoding.UTF8)){
string line = "";
bool isHeader = true;
int index = 0;
model.RowCount = File.ReadAllLines(path).Length;
string[] rows = new string[model.RowCount-1];
while ((line = reader.ReadLine()) != null) {
if (isHeader) {
model.Headers = line.Split(new string[]{"\t"}, StringSplitOptions.RemoveEmptyEntries);
isHeader = false;
continue;
}
rows[index] = line;
index++;
}
model.HeaderCount = model.Headers.Length;
model.Keys = rows;
}
return model;
}
}
我的比较班:
只是想让我知道我想做什么
class Compare {
//Tables CURRENT | NEW
TableModel newModel;
TableModel currentModel;
string dirName;
//REPORT.txt
private static string report;
//Contents
HashSet<string> currentContent;
HashSet<string> newContent;
//Headers
HashSet<string> headersNotFoundInC = new HashSet<string>();
HashSet<string> headersNotFoundInN = new HashSet<string>();
private bool headerSequence = false;
//Rows
HashSet<string> rowNotFoundInC = new HashSet<string>();
HashSet<string> rowNotFoundInN = new HashSet<string>();
//Constructor
public Compare(TableModel newModel, TableModel currentModel, string dirName) {
this.newModel = newModel;
this.currentModel = currentModel;
this.dirName = dirName;
StartCompare();
CreateReportFile();
}
//METHODS
private void CreateReportFile() {
}
private void StartCompare() {
}
public void checkHeaders() {
}
public void checkRows() {
}
public void ShowNotFoundHeaders() {
}
public void ShowNotFoundRows() {
}
public void CheckHeaderCount() {
}
public void CheckRowCount() {
}
public void ReportHeaders() {
}
public void ReportRows() {
}
public void SetTitle(string title) {
}
}
类比较{
//表当前|新
新模型;
TableModel-currentModel;
字符串名称;
//REPORT.txt
私有静态字符串报告;
//内容
HashSet-currentContent;
HashSet-newContent;
//标题
HashSet headersNotFoundInC=新HashSet();
HashSet headersNotFoundInN=新HashSet();
private bool headerSequence=假;
//排
HashSet rowNotFoundInC=新HashSet();
HashSet rowNotFoundInN=新HashSet();
//建造师
公共比较(TableModel newModel、TableModel currentModel、字符串dirName){
this.newModel=newModel;
this.currentModel=currentModel;
this.dirName=dirName;
StartCompare();
CreateReportFile();
}
//方法
私有void CreateReportFile(){
}
私有void StartCompare(){
}
公共void checkHeaders(){
}
公共无效检查行(){
}
public void ShowNotFoundHeaders(){
}
public void ShowNotFoundRows(){
}
公共无效校验头计数(){
}
公共无效检查行计数(){
}
公共void ReportHeaders(){
}
公共void ReportRows(){
}
公共无效集合标题(字符串标题){
}
}
请问一个问题:否则事情会变得混乱。另外:也谈到表格,但你在做文件i/o:你想比较文件还是表格?你在谷歌上搜索过“用c#创建pdf”吗?我编辑了我的问题,是的,我在谷歌上搜索过