I’m having issue generating the report, I’ve follow the example from this link Pivot Table but still unable to get the correct result, I’m using LINQ Reporting Engine.
public class Output
{
public List<Datas1> Datas1 { get; set; }
public List<Datas2> Datas2 { get; set; }
}
public class Datas1
{
public string Name { get; set; }
}
public class Datas2
{
public string Name { get; set; }
public List<Datas1Details> D1Details { get; set; }
}
public class Datas1Details
{
public string Data1Name { get; set; }
public string Score { get;set; }
}
Output output = new Output
{
Datas2 = new List<Datas2> {
new Datas2 {
Name = "Score1",
D1Details = new List<Datas1Details>
{
new Datas1Details
{
Data1Name= "A",
Score = "1",
},
new Datas1Details
{
Data1Name= "B",
Score = "2",
},
new Datas1Details
{
Data1Name= "C",
Score = "2",
}
}
},
new Datas2 {
Name = "Score2",
D1Details = new List<Datas1Details>
{
new Datas1Details
{
Data1Name= "A",
Score = "1",
},
new Datas1Details
{
Data1Name= "B",
Score = "2",
},
new Datas1Details
{
Data1Name= "C",
Score = "2",
}
}
},
new Datas2 {
Name = "Score3",
D1Details = new List<Datas1Details>
{
new Datas1Details
{
Data1Name= "A",
Score = "1",
},
new Datas1Details
{
Data1Name= "B",
Score = "2",
},
new Datas1Details
{
Data1Name= "C",
Score = "2",
}
}
},
},
Datas1 = new List<Datas1>
{
new Datas1
{
Name= "A",
},
new Datas1
{
Name= "B",
},
new Datas1
{
Name= "C",
}
}
}
// Input directory
string dataDir = @"C:\Input.docx";
// Build Aspose
Document doc = new Document(dataDir);
ReportingEngine engine = new ReportingEngine();
engine.Options = ReportBuildOptions.AllowMissingMembers;
engine.BuildReport(doc, output);
// Output directory
dataDir = @"C:\AsposeWord_Test_Output.docx";
// Save the output
doc.Save(dataDir);
Current generated output are wrong
Expected output
Input file
Input.docx (15.1 KB)