Skip to content

Commit

Permalink
Fix bug for display print dialog when print label
Browse files Browse the repository at this point in the history
  • Loading branch information
oybab committed Jul 29, 2020
1 parent d74b42f commit a675431
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions TradingSystem/OybabReport/Model/ReportPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public void PrintReport(object xtraReport, ReportModel reportModel, string Print

XtraReport report = xtraReport as XtraReport;


report.PageHeight = reportModel.PageHeight;
if (reportModel.PageHeight != 0)
report.PageHeight = reportModel.PageHeight;

if (reportModel.IsEAN13Generator)
{
Expand Down Expand Up @@ -60,9 +60,14 @@ public void PrintReport(object xtraReport, ReportModel reportModel, string Print


if (null != PrinterDeviceName)
{
tool.Print(PrinterDeviceName);
}
else
tool.Print();
{
tool.PrintDialog();
}


}
}
Expand Down
4 changes: 2 additions & 2 deletions TradingSystem/OybabRes/Reports/Print.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private Print() { }
/// <param name="model"></param>
/// <param name="Lang"></param>
/// <returns></returns>
public void PrintBarcode(List<ProductLabel> models, int sizeMode)
public void PrintBarcode(List<ProductLabel> models, int sizeMode, int langIndex)
{
object report = null;
if (sizeMode == 0) //4cmX3cm
Expand All @@ -45,7 +45,7 @@ public void PrintBarcode(List<ProductLabel> models, int sizeMode)
reportModel.DataSource = models;


ReportSettings(-1, reportModel, null);
ReportSettings(langIndex, reportModel, null);


if (models.FirstOrDefault().BarcodeNo.Length > 8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void krpbChange_Click(object sender, EventArgs e)
}


Print.Instance.PrintBarcode(models, krpcSize.SelectedIndex);
Print.Instance.PrintBarcode(models, krpcSize.SelectedIndex, krpcLanguage.SelectedIndex);

Resources.GetRes().DefaultPrintLang = krpcLanguage.SelectedIndex;
Resources.GetRes().DefaultBarcodePrintSize = krpcSize.SelectedIndex;
Expand Down

0 comments on commit a675431

Please sign in to comment.