本文整理汇总了C#中Report.Print方法的典型用法代码示例。如果您正苦于以下问题:C# Report.Print方法的具体用法?C# Report.Print怎么用?C# Report.Print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report.Print方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: PrintGrid
private void PrintGrid(Infragistics.Controls.Grids.XamGrid printGrid)
{
Report reportObj = new Report();
EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(printGrid);
reportObj.Sections.Add(section);
// progressInfo.Report = reportObj;
reportObj.Print(true, false);
}
示例3: ispis
private void ispis()
{
DataTable podaci = new DataTable();
veza.ExecuteQuery("select bon_kod, bon_rednibroj, bon_iznos, bon_vazido from bonovi where bon_rednibroj = '" + txtBrojOD.Text + "' and partner_pa_ID = " + pa_ID + "", ref podaci);
if (podaci.Rows.Count > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
podaci.TableName = "Artikli";
FDataSet.Tables.Add(podaci);
// 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/Novikopija.frx");
report.SetParameterValue("Datum", "31.12.2013.");
report.SetParameterValue("Naziv", "ILOČKI PODRUMI D.D. ILOK");
report.SetParameterValue("OIB", "38793818363");
report.SetParameterValue("Sifra", "1430");
report.RegisterData(FDataSet);
//report.Design();
//report.Show();
//report.PrintSettings.ShowDialog = false;
//report.PrintSettings.Printer = PRINTER_NAME;
report.Prepare();
//report.PrintPrepared();
report.Print();
//report.ShowPrepared();
report.Dispose();
veza.ExecuteQuery("update bonovi set bon_brojIspisa = bon_brojIspisa + 1, operater_op_ID2 = " + Global.KorisnikID + " where bon_rednibroj in (" + txtBrojOD.Text.Trim() + ")");
}
else
{
lblPoruka.Text = "Ne postoji bon pod tim brojem!!";
txtBrojOD.Text = "";
txtSifraPartnera.Text = "";
lblPartner.Text = "";
lblPoruka.Refresh();
int milliseconds = 5000;
Thread.Sleep(milliseconds);
lblPoruka.Text = "";
lblPoruka.Refresh();
txtSifraPartnera.Focus();
}
}
示例4: printaj
private void printaj()
{
if (dgBon.RowCount > 0)
{
try
{
//procitajNazivPrintera();
//string skladisteBroj = txtSkladiste.Text;
//string brojNarudzbe = txtBrojNarudzbe.Text;
//string trgovina = txtNazivTrgovine.Text;
//string trgovinasifra = txtSifraTrgovine.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 (dgBon.RowCount > 0)
{
//create dataset
DataSet FDataSet = new DataSet();
tablica.TableName = "Artikli";
FDataSet.Tables.Add(tablica);
// 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/Novi.frx");
report.RegisterData(FDataSet);
//report.Design();
//report.Show();
//report.PrintSettings.ShowDialog = false;
//report.PrintSettings.Printer = PRINTER_NAME;
report.Prepare();
//report.PrintPrepared();
report.Print();
//report.ShowPrepared();
report.Dispose();
//tablica = new DataTable();
FDataSet.Tables.Remove(tablica);
//MessageBox.Show("update bonovi set bon_brojIspisa = bon_brojIspisa + 1, operater_op_ID2 = " + Global.KorisnikID + " where bon_ID in (" + bonoviID + ")");
veza.ExecuteQuery("update bonovi set bon_brojIspisa = bon_brojIspisa + 1, operater_op_ID2 = " + Global.KorisnikID + " where bon_ID in (" + bonoviID + ")");
progressBar1.Visible = false;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
示例5: PrintReport
public void PrintReport(LisReport lr)
{
DataSet ds = CreateDataSet("ReportTables.frd");
FillDataSet(lr, ds);
Report report = new Report();
string modelName = GetReportModelName(lr);
report.Load(GetReprotModelPath(modelName));
report.RegisterData(ds);
report.Prepare();
report.Print();
}
示例6: dgBonovi_KeyDown
//.........这里部分代码省略.........
if (row["ifab_ID"].ToString() == "" && row["bon_ponisten"].ToString() != "True" && row["bon_datumkoristenja"].ToString() == "")
{
result = MessageBox.Show("Svako naknadno ispisivanje bona se bilježi, sigurni ste da želite nastaviti?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
bonkod = row[0].ToString();
brojbona = row[2].ToString();
DataTable podaci = new DataTable();
veza.ExecuteQuery("select bonovi.bon_kod, bonovi.bon_ID, bonovi.bon_iznos, bonovi.bon_vazido, partner.pa_naziv, partner.pa_sifra, partner.pa_OIB from partner, bonovi where partner.pa_ID = bonovi.partner_pa_ID and bon_kod = " + bonkod + " ", ref podaci);
//create dataset
DataSet FDataSet = new DataSet();
podaci.TableName = "Artikli";
FDataSet.Tables.Add(podaci);
// 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/NoviBon.frx");
report.SetParameterValue("brojbona", brojbona);
report.RegisterData(FDataSet);
//report.Design();
//report.Show();
report.Print();
//report.PrintSettings.ShowDialog = true;
//report.Prepare();
//report.PrintPrepared();
//report.ShowPrepared();
report.Dispose();
podaci = new DataTable();
//MessageBox.Show("update bonovi set bon_brojIspisa = bon_brojIspisa + 1, operater_op_ID2 = " + Global.KorisnikID + " where bon_ID in (" + bonoviID + ")");
veza.ExecuteQuery("update bonovi set bon_brojIspisa = bon_brojIspisa + 1, bon_vrijemeIspisa = now(), operater_op_ID2 = " + Global.KorisnikID + " where bon_kod in (" + bonkod + ")");
}
}
}
}
}
}
else if (e.KeyCode == Keys.F7)
{
DataTable bonUnosModul = new DataTable();
veza.ExecuteQuery("select op_ID from operaterovlast where op_ID = '" + Global.KorisnikID + "' and opov_modul = 'BONUNOS' ", ref bonUnosModul);
if (bonUnosModul.Rows.Count > 0)
{
pnlAzuriranjeBona.Visible = true;
dtpDatKor.Format = DateTimePickerFormat.Short;
//dtpDatKor.Text = "";
txtBrojKasa.Text = "";
txtIznosRacuna.Text = "";