本文整理汇总了C#中Report.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Report.Dispose方法的具体用法?C# Report.Dispose怎么用?C# Report.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report.Dispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintPreview
public static void PrintPreview(DataTable data, string fileName)
{
Report report = new Report();
report.Load(fileName);
report.RegisterData(data, fileName);
//这样就可以预览数据了
report.Show();
report.Dispose();
}
示例2: btnListaUkupno_Click
private void btnListaUkupno_Click(object sender, EventArgs e)
{
if (dgArtikli.Rows.Count > 0)
{
try
{
DataTable artikli = new DataTable();
artikli = pregled_akcijskih_nabavnih_cijena.Tables["Table"].Copy();
string partner = glDobavljac.Text;
string datumOD = Convert.ToDateTime(dtpODkada.Text).ToString("dd-MM-yyyy");
string datumDO = Convert.ToDateTime(dtpDokada.Text).ToString("dd-MM-yyyy");
//pregled_akcijskih_nabavnih_cijena.PregledAkcNabCijena.Copy();
//pregled_akcijskih_nabavnih_cijena.PregledAkcNabCijena.CopyToDataTable(artikli,LoadOption.Upsert);
//veza.ExecuteQuery("select poslovnica.po_ID, poslovnica.po_sifra, poslovnica.po_naziv, mjesto.mj_naziv, poslovnica.po_asortiman, poslovnica.po_cjenik from poslovnica, mjesto where mjesto.mj_ID = poslovnica.mjesto_mj_ID and poslovnica.po_aktivna = 1 and poslovnica.po_datumZatvaranja is null and (poslovnica.vp_sifra = 300 or poslovnica.vp_sifra =200) and (poslovnica.po_cjenik <> '' or poslovnica.po_asortiman <> '') order by poslovnica.po_sifra asc", ref artikli);
if (dgArtikli.Rows.Count > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
artikli.TableName = "Artikli";
FDataSet.Tables.Add(artikli);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/PregledAkcNabCijena.frx");
// register the dataset
report.RegisterData(FDataSet);
report.SetParameterValue("Partner", partner);
report.SetParameterValue("DatumOD", datumOD);
report.SetParameterValue("DatumDO", datumDO);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
示例3: GenderPDFReport
public void GenderPDFReport(LisReport lr, string rootPath,DataSet ds)
{
//清空数据库
ClearDataSet(ds);
//填充数据
FillDataSet(lr, ds);
Report report = new Report();
//获取模板
string modelName = GetReportModelName(lr);
//获取生成文件全路径
string fileFullName = GenderFileFullName(lr.ReportInfo, rootPath, lr.OrderNo);
report.Load(GetReprotModelPath(modelName));
report.RegisterData(ds);
report.Prepare();
PDFExport export = new PDFExport();
//这里针对像流式这种生成PDF之后还要处理的情况。
if (AfterCreatPDF(lr.ReportInfo.SectionNo))
{
string linshi = rootPath + "\\liushi\\linshi.pdf";
report.Export(export, linshi);
report.Dispose();
List<MyMergePdf> lm = new List<MyMergePdf>();
lm.Add(new MyMergePdf { Name = linshi });
string liushiPDFname = getliushiname(lr.ReportInfo.SerialNo, lr.ReportInfo.SampleNo, rootPath);
if (liushiPDFname != "")
{
try
{
int page = Convert.ToInt32(liushiPDFname.Split('_')[2].Split('.')[0]);
lm.Add(new MyMergePdf { Name = rootPath + "\\liushi\\" + liushiPDFname, PagCount = page });
}
catch { }
}
mergePDFFiles(lm, fileFullName);
}
//一般情况。
else
{
report.Export(export, fileFullName);
report.Dispose();
}
}
示例4: btnIzvjestaj_Click
private void btnIzvjestaj_Click(object sender, EventArgs e)
{
if (gridView2.RowCount > 0)
{
try
{
DataTable artikli = new DataTable();
artikli = dodatnePozicijeZaTrgovinu.DodatneTrgovina.CopyToDataTable();
string datOD = Convert.ToDateTime(dtpDatumOD.Text).ToString("dd-MM-yyyy");
string datDO = Convert.ToDateTime(dtpDatumDO.Text).ToString("dd-MM-yyyy");
//string skladisteBroj = txtSkladiste.Text;
//string brojNarudzbe = txtBrojNarudzbe.Text;
//veza.ExecuteQuery("select poslovnica.po_ID, poslovnica.po_sifra, poslovnica.po_naziv, mjesto.mj_naziv, poslovnica.po_asortiman, poslovnica.po_cjenik from poslovnica, mjesto where mjesto.mj_ID = poslovnica.mjesto_mj_ID and poslovnica.po_aktivna = 1 and poslovnica.po_datumZatvaranja is null and (poslovnica.vp_sifra = 300 or poslovnica.vp_sifra =200) and (poslovnica.po_cjenik <> '' or poslovnica.po_asortiman <> '') order by poslovnica.po_sifra asc", ref artikli);
if (gridView2.RowCount > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
artikli.TableName = "Artikli";
FDataSet.Tables.Add(artikli);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/DogovorenePozicijeTrgovina.frx");
report.SetParameterValue("datumod", datOD);
report.SetParameterValue("datumdo", datDO);
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
示例5: btnIspisi_Click
private void btnIspisi_Click(object sender, EventArgs e)
{
try
{
if (dgPodaci.RowCount > 0)
{
try
{
DataTable artikli = new DataTable();
artikli = slanje_na_knjizenje.SlanjeNaKnjizenje.CopyToDataTable();
string datumSlanja = Convert.ToDateTime(dtpPredaja.EditValue).ToString("dd.MM.yyyy");
//create dataset
DataSet FDataSet = new DataSet();
artikli.TableName = "Artikli";
FDataSet.Tables.Add(artikli);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/Knjizenje3.frx");
report.SetParameterValue("datumSlanja", datumSlanja);
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例6: btnAsortimanCjenik_Click
private void btnAsortimanCjenik_Click(object sender, EventArgs e)
{
if (gridView2.RowCount > 0)
{
try
{
DataTable artikli = new DataTable();
veza.ExecuteQuery("select poslovnica.po_ID, poslovnica.po_sifra, poslovnica.po_naziv, mjesto.mj_naziv, poslovnica.po_asortiman, poslovnica.po_cjenik from poslovnica, mjesto where mjesto.mj_ID = poslovnica.mjesto_mj_ID and poslovnica.po_aktivna = 1 and poslovnica.po_datumZatvaranja is null and (poslovnica.vp_sifra = 300 or poslovnica.vp_sifra =200) and (poslovnica.po_cjenik <> '' or poslovnica.po_asortiman <> '') order by poslovnica.po_sifra asc", ref artikli);
if (artikli.Rows.Count > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
artikli.TableName = "Artikli";
FDataSet.Tables.Add(artikli);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/ListaAsortimanCjenik.frx");
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
示例7: ispis
public void ispis(string broj)
{
try
{
DataTable finacijsko = new DataTable();
veza.ExecuteQuery("select partner.pa_sifra, partner.PA_NAZIV, gratis.gr_datum, gratis.akc_broj, gratis.gr_vrijednostsnizenja, gratis.gr_zapisnik, poslovnica.po_sifra, poslovnica.po_naziv from gratis left join poslovnica on poslovnica.po_id=gratis.poslovnica_PO_ID left join partner on partner.PA_ID=gratis.partneri_PA_ID where gratis.akc_broj ='"+broj+"'", ref finacijsko);
if (finacijsko.Rows.Count > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
finacijsko.TableName = "Financijsko";
FDataSet.Tables.Add(finacijsko);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/Financijsko_snizenja.frx");
// register the dataset
report.RegisterData(FDataSet);
report.SetParameterValue("Mjesec", "2");
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
}
catch (Exception ex)
{
}
}
示例8: Print
public static void Print(DataTable data, string fileName,MemoryStream ms=null)
{
//不显示打印进度条
setting.ReportSettings.ShowProgress = false;
Report report = new Report();
report.Load(fileName);
report.PrintSettings.ShowDialog = false;
report.RegisterData(data, fileName);
if (ms != null)
{
object obj = report.FindObject("Picture1");
{
if(obj!=null)
((PictureObject)obj).Image = System.Drawing.Image.FromStream(ms);
}
}
//这样就可以打印数据了
report.Print();
report.Dispose();
}
示例9: frmPoslovniceUKojeIdeDobavljac_KeyDown
private void frmPoslovniceUKojeIdeDobavljac_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.KeyCode == Keys.F5)
{
try
{
DataTable artikli = new DataTable();
veza.ExecuteQuery("select poslovnica.po_sifra, poslovnica.po_naziv, poslovnica.po_asortiman, partner.pa_naziv from poslovnica, dobavljacposlovnica, partner where dobavljacposlovnica.poslovnica_po_ID = poslovnica.po_ID and partner.pa_ID = "+glDobavljac.EditValue+" and dobavljacposlovnica.partner_pa_ID = partner.pa_ID and po_datumZatvaranja is null and (vp_sifra = '300' or vp_sifra ='200') ORDER BY po_asortiman", ref artikli);
if (gridView1.RowCount > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
artikli.TableName = "Artikli";
FDataSet.Tables.Add(artikli);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/poslovnice_dobavljac.frx");
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
//string IDpartnera = glDobavljac.EditValue.ToString();
//System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
//string baseDir = System.IO.Path.GetDirectoryName(a.Location);
//report1.Load(baseDir + "/report/poslovnice_dobavljac.frx");
//report1.SetParameterValue("IDpartnera", IDpartnera);
////report1.Load("C:/Users/IvanS/Documents/Visual Studio 2010/Projects/odobrenja_3.3/Report.frx");
//report1.Show();
}
else if (e.KeyCode == Keys.Enter)
{
SendKeys.Send("{TAB}");
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.Escape)
{
this.Close();
}
else if (e.KeyCode == Keys.F9)
{
DialogResult result;
result = MessageBox.Show("Želite prijenos podataka u excel?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
ExcelExport();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例10: btnNezaduzene_Click
private void btnNezaduzene_Click(object sender, EventArgs e)
{
try
{
DataTable gratis = new DataTable();
veza.ExecuteQuery("select uf_broj, uf_datum, poslovnica_po_ID, uf_memo, uf_iznos from ufaifa where partner_pa_ID =' 5061' AND uf_STATUS <>'S' and uf_broj not in (select ufaifa_uf_broj from gratis where ufaifa_uf_broj is not null and ufaifa_uf_broj <>'')", ref gratis);
if (gratis.Rows.Count > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
gratis.TableName = "Artikli";
FDataSet.Tables.Add(gratis);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/Gratis.frx");
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例11: report
private void report()
{
try
{
DataTable partner = new DataTable();
veza.ExecuteQuery("select partner.PA_NAZIV, partner.PA_ADRESA, mjesto.mj_naziv, mjesto.mj_posta, partner.PA_OIB, partner.PA_SIFRA from mjesto, partner where partner.mjesto_mj_ID = mjesto.mj_ID and partner.PA_ID = "+_IDpartner+"", ref partner);
DataTable porez = new DataTable();
veza.ExecuteQuery("SELECT p1.pz_posto, SUM( p1.pr_iznosneto) as 'Vrijednost' , SUM( p1.pr_porezIznos) as 'Porez' FROM ifabonstavka p1 WHERE p1.ifab_ID = " + noviBrojFakture + " GROUP BY 1 ORDER BY 1 DESC", ref porez);
DataTable zaglavlje = new DataTable();
veza.ExecuteQuery("select ifabon.*, concat (operater.op_ime, ' ', operater.op_prezime) as operater from operater, ifabon where ifabon.ifab_operater = operater.op_ID and ifab_ID = "+noviBrojFakture+"", ref zaglavlje);
DataTable stavke = new DataTable();
stavke = stavkeBona.ifabonstavka_tmp.CopyToDataTable();
//veza.ExecuteQuery("select ifabonstavka.* from ifabonstavka where ifabonstavka.ifab_ID= " + noviBrojFakture + "", ref stavke);
DataSet FDataSet = new DataSet();
zaglavlje.TableName = "Zaglavlje";
stavke.TableName = "Stavke";
porez.TableName = "Porez";
partner.TableName = "Partner";
FDataSet.Tables.Add(zaglavlje);
FDataSet.Tables.Add(stavke);
FDataSet.Tables.Add(porez);
FDataSet.Tables.Add(partner);
// create report instance
Report report = new Report();
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/Faktura.frx");
report.RegisterData(FDataSet);
//report.Design();
report.Show();
report.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例12: btnIspis_Click
private void btnIspis_Click(object sender, EventArgs e)
{
if (dgPodaci.RowCount > 0)
{
try
{
DataTable artikli = new DataTable();
artikli = status_poste.statusPoste.CopyToDataTable();
//create dataset
DataSet FDataSet = new DataSet();
artikli.TableName = "Artikli";
FDataSet.Tables.Add(artikli);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/Sve.frx");
if (dtpDO.Text != "" && dtpOD.Text != "")
{
string OD = Convert.ToDateTime(dtpOD.EditValue).ToString("dd.MM.yyyy");
string DO = Convert.ToDateTime(dtpDO.EditValue).ToString("dd.MM.yyyy");
report.SetParameterValue("datumod", OD);
report.SetParameterValue("datumdo", DO);
}
if (glPartner.Text != "")
{
report.SetParameterValue("partner", glPartner.Text);
}
if (glVrstaTroska.Text != "")
{
report.SetParameterValue("vrstaTroska", glVrstaTroska.Text);
}
report.SetParameterValue("evidBroj", txtEvidBroj.Text.Trim());
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
示例13: reportOznaceni
private void reportOznaceni()
{
if (dgPodaci.RowCount > 0)
{
try
{
table = new DataTable();
napunipotvrdjeneZaPredajuUDataset();
string OD = Convert.ToDateTime(dtpOD.EditValue).ToString("dd.MM.yyyy");
string DO = Convert.ToDateTime(dtpDO.EditValue).ToString("dd.MM.yyyy");
//create dataset
DataSet FDataSet = new DataSet();
table.TableName = "Artikli";
FDataSet.Tables.Add(table);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/Predaja.frx");
report.SetParameterValue("datumod", OD);
report.SetParameterValue("datumdo", DO);
report.SetParameterValue("datumPredaje", DateTime.Now.Date.ToString("dd.MM.yyyy"));
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
示例14: dgBonovi_KeyDown
private void dgBonovi_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.KeyCode == Keys.F2)
{
//report detalji bona
if (dgBon.RowCount > 0)
{
try
{
System.Data.DataRow row = dgBon.GetDataRow(dgBon.FocusedRowHandle);
if (row != null)
{
bonkod = row[0].ToString();
}
podaciZaReport = new DataTable();
veza.ExecuteQuery("select bonovi.bon_kod, partner.PA_NAZIV, bonovi.bon_rednibroj , bonovi.bon_datumizrade , bonovi.bon_iznos, bonovi.bon_datumkoristenja, bonovi.bon_iznosracuna, bonovi.ifab_ID, concat(operater.op_ime,'',operater.op_prezime), bon_ponisten , bonovi.bon_kasa, bonovi.bon_vazido, bonovi.bon_racunnakasi, poslovnica.po_naziv, ifabon.ifab_datum from operater, bonovi left outer join partner on partner.PA_ID = bonovi.partner_pa_ID left outer join poslovnica on poslovnica.po_id = bonovi.poslovnica_po_ID left outer join ifabon on ifabon.ifab_ID = bonovi.ifab_ID where bonovi.bon_kod = " + bonkod + " and operater.op_ID= bonovi.operater_op_ID", ref podaciZaReport);
if (podaciZaReport.Rows.Count > 0)
{
//DataTable artikli = new DataTable();
//artikli = izdani_bonovi.bonovi.CopyToDataTable();
//create dataset
DataSet FDataSet = new DataSet();
podaciZaReport.TableName = "Artikli";
FDataSet.Tables.Add(podaciZaReport);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/DetaljiBona.frx");
//report.SetParameterValue("datumPredaje", DateTime.Now.Date.ToString("dd.MM.yyyy"));
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
else if (e.KeyCode == Keys.F3) //poništi bon
{
DataTable bonPonistiModul = new DataTable();
veza.ExecuteQuery("select op_ID from operaterovlast where op_ID = '" + Global.KorisnikID + "' and opov_modul = 'BONPONISTI' ", ref bonPonistiModul);
if (bonPonistiModul.Rows.Count > 0)
{
provjeriBon();
}
}
else if (e.KeyCode == Keys.F4) //report koji nisu iskoristeni
{
if (dgBon.RowCount > 0 && glPartner.Text != "")
{
try
{
string prvi = Convert.ToDateTime(dtpOdKada.Text).ToString("yyyy-MM-dd");
string drugi = Convert.ToDateTime(dtpDoKada.Text).ToString("yyyy-MM-dd");
podaciZaReport = new DataTable();
veza.ExecuteQuery("select bonovi.bon_kod, partner.PA_NAZIV, bonovi.bon_rednibroj , bonovi.bon_datumizrade , bonovi.bon_iznos, bonovi.bon_datumkoristenja, bonovi.bon_iznosracuna, bonovi.ifab_ID, concat(operater.op_ime,'',operater.op_prezime), bon_ponisten , bonovi.bon_kasa, bonovi.bon_vazido, bonovi.bon_racunnakasi, poslovnica.po_naziv, ifabon.ifab_datum from operater, bonovi left outer join partner on partner.PA_ID = bonovi.partner_pa_ID left outer join poslovnica on poslovnica.po_id = bonovi.poslovnica_po_ID left outer join ifabon on ifabon.ifab_ID = bonovi.ifab_ID where operater.op_ID= bonovi.operater_op_ID and partner.PA_ID = " + glPartner.EditValue + " and bonovi.bon_datumkoristenja is null and bonovi.bon_datumizrade between '" + prvi + "' and '" + drugi + "'", ref podaciZaReport);
if (podaciZaReport.Rows.Count > 0)
{
//DataTable artikli = new DataTable();
//artikli = izdani_bonovi.bonovi.CopyToDataTable();
//create dataset
DataSet FDataSet = new DataSet();
podaciZaReport.TableName = "Artikli";
FDataSet.Tables.Add(podaciZaReport);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
//.........这里部分代码省略.........
示例15: dgBonovi_KeyDown
private void dgBonovi_KeyDown(object sender, KeyEventArgs e)
{
if (dgBon.RowCount > 0)
{
if (e.KeyCode == Keys.F3)
{
}
else if (e.KeyCode == Keys.F5)
{
if (dgBon.RowCount > 0)
{
try
{
podaciZaReport = new DataTable();
podaciZaReport = fakturirani_bonovi.bonovi.CopyToDataTable();
if (dtpDoKada.Text != "" && dtpOdKada.Text != "")
{
datumOD = Convert.ToDateTime(dtpOdKada.Text).ToString("yyyy-MM-dd");
datumDO = Convert.ToDateTime(dtpDoKada.Text).ToString("yyyy-MM-dd");
}
//create dataset
DataSet FDataSet = new DataSet();
podaciZaReport.TableName = "Artikli";
FDataSet.Tables.Add(podaciZaReport);
// create report instance
Report report = new Report();
// load the existing report
System.Reflection.Assembly a = System.Reflection.Assembly.GetEntryAssembly();
string baseDir = System.IO.Path.GetDirectoryName(a.Location);
report.Load(baseDir + "/report/FakturiraniLista.frx");
report.SetParameterValue("datumOD", datumOD);
report.SetParameterValue("datumDO", datumDO);
// register the dataset
report.RegisterData(FDataSet);
//dizajn
//report.Design();
// run the report
report.Show();
// free resources used by report
report.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
else if (e.KeyCode == Keys.F8)
{
report();
}
else if (e.KeyCode == Keys.F9)
{
DataTable IFAStornoModul = new DataTable();
veza.ExecuteQuery("select op_ID from operaterovlast where op_ID = '" + Global.KorisnikID + "' and opov_modul = 'IFABONSTORNO' ", ref IFAStornoModul);
if (IFAStornoModul.Rows.Count > 0)
{
System.Data.DataRow row = dgBon.GetDataRow(dgBon.FocusedRowHandle);
if (row != null)
{
IFAID = row[0].ToString();
DialogResult result;
result = MessageBox.Show("Želite stornirati račun broj: " + row[0].ToString() + "?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
veza.ExecuteQuery("Update ifabon set ifab_status = 'S' where ifab_ID = " + IFAID + " ");
//update bonovi gdje je prethodni ifab_ID treba ga maknut
veza.ExecuteQuery("update bonovi set ifab_ID = null where ifab_ID = " + IFAID + "");
btnPrikazi.PerformClick();
}
}
}
}
else if (e.KeyCode == Keys.F7)
{
DataTable IFAStornoModul = new DataTable();
veza.ExecuteQuery("select op_ID from operaterovlast where op_ID = '" + Global.KorisnikID + "' and opov_modul = 'IFABONIZMJENA' ", ref IFAStornoModul);
//.........这里部分代码省略.........