using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HO.MCAA.GHD.Model;
using HO.MCAA.GHD.Controls;
using HO.MCAA.GHD.Reports;
using HiimelOyun.App.Lib.Settings;
using System.Collections;
namespace HO.MCAA.GHD.Jagsaalt
{
public partial class frmProductRequestReportViewer : Form
{
public ProductRequestHeaderInfo DataHeader { get; set; }
public frmProductRequestReportViewer()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
protected override void OnClosing(CancelEventArgs e)
{
//this.reportViewer.Report.Dispose();
this.reportViewer1.Dispose();
base.OnClosing(e);
}
private void frmProductRequestReportViewer_Load(object sender, EventArgs e)
{
ProductRequestReport report = new ProductRequestReport();
Hashtable setting = FormSettingManager.loadSetting(FormSettingManager.GetFilename("frmSetting"));
try
{
report.DataSource = DataHeader.ProductRequestDetails.ToList();
string parDate = DataHeader.RequestDate.Year + " оны " + DataHeader.RequestDate.Month
+ " -р сарын " + DataHeader.RequestDate.Day + " -ны өдөр";
string parCentre = (setting["Setting_CentreName"] + string.Empty).ToString();
string parCode = (setting["Setting_CentreCode"] + string.Empty).ToString();
//report.ReportParameters["ParDate"].Text;
report.ReportParameters["ParDate"].Value = parDate;
report.ReportParameters["ParCentre"].Value = parCentre;
report.ReportParameters["ParCode"].Value = parCode;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Алдаа", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
}
try
{
string companyLogo32 = (setting["Setting_CompanyLogo48"] + string.Empty).ToString();
report.LogoBox.Style.BackgroundImage.ImageData = new Bitmap(companyLogo32);
}
catch { }
// perform additional operations on the report object if needed
Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = report;
this.reportViewer1.ReportSource = instanceReportSource;
//this.reportViewer1.Report = report;
this.reportViewer1.RefreshReport();
}
}
}
No comments:
Post a Comment