Report Erzeugung aus ENI funktional, das alte Kontext-menü ist aber noch drin
This commit is contained in:
parent
c1a4540c86
commit
04a086548a
@ -556,7 +556,8 @@ namespace ENI2.DetailViewControls
|
|||||||
// create PDF from message classes
|
// create PDF from message classes
|
||||||
if (rm.Create(sfd.FileName, this.Core, sicd.SelectedClasses, out string importResultText))
|
if (rm.Create(sfd.FileName, this.Core, sicd.SelectedClasses, out string importResultText))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Report created", "Success", MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBox.Show("Report created: " + sfd.FileName, "Success", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
// Clipboard.SetText(sfd.FileName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -702,6 +702,14 @@
|
|||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Content Include="..\misc\Logo.gif">
|
||||||
|
<Link>Report\Logo.gif</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="..\misc\report.db">
|
||||||
|
<Link>report.db</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<None Include="ENI2_2_TemporaryKey.pfx" />
|
<None Include="ENI2_2_TemporaryKey.pfx" />
|
||||||
<None Include="ENI2_3_TemporaryKey.pfx" />
|
<None Include="ENI2_3_TemporaryKey.pfx" />
|
||||||
<None Include="ENI2_4_TemporaryKey.pfx" />
|
<None Include="ENI2_4_TemporaryKey.pfx" />
|
||||||
|
|||||||
@ -22,7 +22,7 @@ namespace ENI2.Report
|
|||||||
static LabelStorage()
|
static LabelStorage()
|
||||||
{
|
{
|
||||||
_con = new SQLiteConnection(string.Format("data source={0}; Version=3;", _locode_DB_NAME));
|
_con = new SQLiteConnection(string.Format("data source={0}; Version=3;", _locode_DB_NAME));
|
||||||
_con.Open();
|
_con.Open();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region public static properties
|
#region public static properties
|
||||||
|
|||||||
@ -77,10 +77,8 @@ namespace ENI2.Report
|
|||||||
#region create document
|
#region create document
|
||||||
|
|
||||||
|
|
||||||
internal static Document CreateSingleClassDocument(MessageCore reportCore, List<Message> reportMessages,
|
internal static Document CreateSingleClassDocument(MessageCore reportCore, Dictionary<string, string> coverInfos, string classes, ReportingParty rp)
|
||||||
Dictionary<string, string> coverInfos, string classes, ReportingParty rp)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
Document document = new Document();
|
Document document = new Document();
|
||||||
document.Info.Title = string.Format("{0} for {1}", classes, reportCore.DisplayId);
|
document.Info.Title = string.Format("{0} for {1}", classes, reportCore.DisplayId);
|
||||||
document.Info.Subject = "Reporting class info";
|
document.Info.Subject = "Reporting class info";
|
||||||
@ -260,7 +258,7 @@ namespace ENI2.Report
|
|||||||
table.AddColumn(140);
|
table.AddColumn(140);
|
||||||
|
|
||||||
Row row = table.AddRow();
|
Row row = table.AddRow();
|
||||||
Image logoImage = row.Cells[0].AddImage("Logo.gif"); // kann man offenbar nur von einem Pfad laden
|
Image logoImage = row.Cells[0].AddImage(@"Report\Logo.gif"); // kann man offenbar nur von einem Pfad laden
|
||||||
logoImage.Width = 80;
|
logoImage.Width = 80;
|
||||||
row.Cells[0].MergeDown = 6;
|
row.Cells[0].MergeDown = 6;
|
||||||
|
|
||||||
@ -880,7 +878,7 @@ namespace ENI2.Report
|
|||||||
for (int i = 0; i < mdh.InfectedAreas.Count; i++)
|
for (int i = 0; i < mdh.InfectedAreas.Count; i++)
|
||||||
{
|
{
|
||||||
Row row = table.AddRow();
|
Row row = table.AddRow();
|
||||||
row.Cells[0].AddParagraph(mdh.InfectedAreas[i].Identifier);
|
row.Cells[0].AddParagraph(mdh.InfectedAreas[i].Identifier ?? i.ToString());
|
||||||
row.Cells[1].AddParagraph(mdh.InfectedAreas[i].InfectedAreaPort);
|
row.Cells[1].AddParagraph(mdh.InfectedAreas[i].InfectedAreaPort);
|
||||||
row.Cells[2].AddParagraph(mdh.InfectedAreas[i].InfectedAreaDate.HasValue ? mdh.InfectedAreas[i].InfectedAreaDate.Value.ToShortDateString() : "");
|
row.Cells[2].AddParagraph(mdh.InfectedAreas[i].InfectedAreaDate.HasValue ? mdh.InfectedAreas[i].InfectedAreaDate.Value.ToShortDateString() : "");
|
||||||
}
|
}
|
||||||
@ -1447,10 +1445,10 @@ namespace ENI2.Report
|
|||||||
row.Cells[5].AddParagraph(towd.TowageOnDepartureDraught_DMT.HasValue ? towd.TowageOnDepartureDraught_DMT.Value.ToString() : "");
|
row.Cells[5].AddParagraph(towd.TowageOnDepartureDraught_DMT.HasValue ? towd.TowageOnDepartureDraught_DMT.Value.ToString() : "");
|
||||||
row.Cells[6].AddParagraph(towd.TowageOnDepartureRemarks ?? "");
|
row.Cells[6].AddParagraph(towd.TowageOnDepartureRemarks ?? "");
|
||||||
row.Cells[7].AddParagraph(towd.TowageOnDepartureOperatorCompanyName ?? "");
|
row.Cells[7].AddParagraph(towd.TowageOnDepartureOperatorCompanyName ?? "");
|
||||||
row.Cells[8].AddParagraph(towd.TowageOnDepartureOperatorStreetNameAndNumber);
|
row.Cells[8].AddParagraph(towd.TowageOnDepartureOperatorStreetNameAndNumber ?? "");
|
||||||
row.Cells[9].AddParagraph(towd.TowageOnDepartureOperatorPostalCode);
|
row.Cells[9].AddParagraph(towd.TowageOnDepartureOperatorPostalCode ?? "");
|
||||||
row.Cells[10].AddParagraph(towd.TowageOnDepartureOperatorCountry ?? "");
|
row.Cells[10].AddParagraph(towd.TowageOnDepartureOperatorCountry ?? "");
|
||||||
row.Cells[11].AddParagraph(towd.TowageOnDepartureOperatorPhone);
|
row.Cells[11].AddParagraph(towd.TowageOnDepartureOperatorPhone ?? "");
|
||||||
row.Cells[12].AddParagraph(towd.TowageOnDepartureOperatorFax ?? "");
|
row.Cells[12].AddParagraph(towd.TowageOnDepartureOperatorFax ?? "");
|
||||||
row.Cells[13].AddParagraph(towd.TowageOnDepartureOperatorEmail ?? "");
|
row.Cells[13].AddParagraph(towd.TowageOnDepartureOperatorEmail ?? "");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ namespace ENI2.Report
|
|||||||
coverInfos.Add("Visit-ID", core.DisplayId);
|
coverInfos.Add("Visit-ID", core.DisplayId);
|
||||||
coverInfos.Add("Class", classes);
|
coverInfos.Add("Class", classes);
|
||||||
|
|
||||||
Document migraDocument = ReportDocument.CreateSingleClassDocument(core, reportMessages, coverInfos, classes, ReportingParty.CurrentReportingParty);
|
Document migraDocument = ReportDocument.CreateSingleClassDocument(core, coverInfos, classes, ReportingParty.CurrentReportingParty);
|
||||||
|
|
||||||
// print messages to document
|
// print messages to document
|
||||||
foreach (Message message in reportMessages)
|
foreach (Message message in reportMessages)
|
||||||
@ -65,6 +65,7 @@ namespace ENI2.Report
|
|||||||
|
|
||||||
ReportDocument.RenderDocument(migraDocument, filePath);
|
ReportDocument.RenderDocument(migraDocument, filePath);
|
||||||
_log.InfoFormat("Created PDF document: {0}", filePath);
|
_log.InfoFormat("Created PDF document: {0}", filePath);
|
||||||
|
result = true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user