本文整理汇总了C#中ReportDocument.ExportToDisk方法的典型用法代码示例。如果您正苦于以下问题:C# ReportDocument.ExportToDisk方法的具体用法?C# ReportDocument.ExportToDisk怎么用?C# ReportDocument.ExportToDisk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReportDocument
的用法示例。
在下文中一共展示了ReportDocument.ExportToDisk方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button1_Click
private void button1_Click(object sender, EventArgs e)
{
try
{
ReportDocument rd;
rd = new ReportDocument();
rd.Load(@"C:\Users\PLABON\Documents\Visual Studio 2013\Projects\SalesAndInventorySystem\SalesAndInventorySystemUI\Report\a.rpt");
List<PersonType> company = companyGateway.GetCompanies();
var companyX = company.Select(x => new {x.ID, x.Name});
rd.SetDataSource(companyX);
crystalReportViewer1.ReportSource = rd;
crystalReportViewer1.Refresh();
int a = 10;
if (File.Exists(@"D:\" + "AAAA" + a +".pdf"))
File.Delete(@"D:\" + a++ + ".pdf");
rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"D:\" + a + ".pdf");
}
catch (Exception)
{
throw;
}
}
示例2: Exportar
public void Exportar(string key)
{
try
{
ReportDocument objRpt = new ReportDocument();
DataSet ds = (DataSet)this.GetDataReport(key);
string reportPath = "C:\\Reportes\\CRTejTicket_rpt.rpt";
objRpt.Load(reportPath);
ExportOptions crExportOptions = new ExportOptions();
objRpt.SetDataSource(ds.Tables[0]);
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.InitialDirectory = Environment.SpecialFolder.MyDocuments.ToString();
saveFileDialog.Filter = "Document (*.pdf)|*.PDF";
saveFileDialog.FilterIndex = 1;
saveFileDialog.FileName = "Etiqueta.pdf";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
objRpt.ExportToDisk(ExportFormatType.PortableDocFormat, saveFileDialog.FileName); ;
}
crExportOptions = objRpt.ExportOptions;
objRpt.Export();
}
catch (Exception ex)
{
ex.ToString();
}
}
示例3: CustomerTransactionReportForm_Load
private void CustomerTransactionReportForm_Load(object sender, EventArgs e)
{
ReportDocument cryRpt;
using (Devart.Data.SQLite.SQLiteConnection myConn = new Devart.Data.SQLite.SQLiteConnection(myConfig.connstr))
{
using (SQLiteCommand myCmd = new SQLiteCommand(sqlcmd, myConn))
{
myConn.Open();
using (SQLiteDataReader myReader = myCmd.ExecuteReader())
{
dataSet2.customer_trans.Load(myReader);
myConn.Close();
}
}
}
this.customerTableAdapter1.Fill(this.dataSet2.customer);
this.configurationTableAdapter1.Fill(this.dataSet2.configuration);
CustomerTransactionReport rpt = new CustomerTransactionReport();
rpt.SetDataSource(this.dataSet2);
cryRpt = new ReportDocument();
cryRpt.Load(rpt.FileName.ToString());
cryRpt.SetDataSource(this.dataSet2);
cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, ReportFolder.reportFolderName + @"\CustomerTransactions.pdf");
}
示例4: Button7_Click1
protected void Button7_Click1(object sender, EventArgs e)
{
ReportDocument reporte = new ReportDocument();
reporte.Load(@"C:\Users\Jorge\Documents\Visual Studio 2013\WebSites\Quetzal\Reporte3.rpt");
ExportFormatType tipo = ExportFormatType.PortableDocFormat;
reporte.ExportToDisk(tipo, @"C:\Users\Jorge\EmpleadosSuc.pdf");
}
示例5: btnAceptar_Click
protected void btnAceptar_Click(object sender, EventArgs e)
{
DateTime desde = new DateTime();
DateTime hasta = new DateTime();
//desde = Convert.ToDateTime(pMetodos.ConvertmmddyyyyToyyyymmdd(dpDesde.Text));
//hasta = Convert.ToDateTime(pMetodos.ConvertmmddyyyyToyyyymmdd(dpHasta.Text));
desde = Convert.ToDateTime(pMetodos.ConvertddmmyyyyToyyyymmdd(dpDesde.Text));
hasta = Convert.ToDateTime(pMetodos.ConvertddmmyyyyToyyyymmdd(dpHasta.Text));
string ctc = ddlCTC.SelectedValue;
string url = "CrystalViewer.aspx?reporte=VentaTotalxCTCxCliente&ctc=" + ctc + "&desde=" + pMetodos.ConvertddmmyyyyToyyyymmdd(dpDesde.Text) + "&hasta=" + pMetodos.ConvertddmmyyyyToyyyymmdd(dpHasta.Text) +"&cliente=" + ddlClientes.SelectedValue;
//ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "OpenPopUp('" + url + "');", true);
ArrayList parametros = new ArrayList();
dsReportes ds = new dsReportes();
parametros.Add(desde);
parametros.Add(hasta);
parametros.Add(ddlClientes.SelectedValue);
parametros.Add(ctc);
ds.tVentaTotalCTCxCliente.Merge(conReportes.VentaTotalxCTCxCliente(parametros));
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new ReportDocument();
rpt.FileName = Server.MapPath("~/RPT/VentaTotalxCTCxCliente.rpt");
rpt.Load(rpt.FileName, OpenReportMethod.OpenReportByDefault);
rpt.SetDataSource(ds);
crviewer.ReportSource = rpt;
//rpt.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "ajdsfaklj");
string fileName = ddlCTC.SelectedItem.Text + "xCliente";
rpt.ExportToDisk(ExportFormatType.PortableDocFormat, Server.MapPath("files/" + fileName + ".pdf"));
ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "desactivarSpinner();", true);
ClientScript.RegisterStartupScript(this.Page.GetType(), "popupOpener", "var hidden = open('files/" + fileName + ".pdf', 'NewWindow', 'top=25,left=300,width=800, height=600,status=yes,resizable=yes,scrollbars=yes');", true);
/*DataTable dt = conReportes.VentaTotalxCTCxCliente(parametros);
gvListadoReporte.DataSource = dt;
gvListadoReporte.DataBind();
Chart1.Visible = true;
string[] x = new string[dt.Rows.Count];
int[] y = new int[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
x[i] = dt.Rows[i][0].ToString();
y[i] = Convert.ToInt32(dt.Rows[i][1]);
}
Chart1.Series[0].Points.DataBindXY(x, y);
Chart1.Series[0].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Bar;// SeriesChartType.Pie;
Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
*/
}
示例6: exportReport
public static bool exportReport(int type, ReportDocument repd)
{
SaveFileDialog f = new SaveFileDialog();
bool result = false;
switch (type)
{
case 1:
f.Filter = "Word file(*.doc)|*.doc";
if (f.ShowDialog() == DialogResult.OK)
{
repd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.WordForWindows, f.FileName);
result = true;
}
break;
case 2:
f.Filter = "Pdf file(*.pdf)|*.pdf";
if (f.ShowDialog() == DialogResult.OK)
{
repd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, f.FileName);
result = true;
}
break;
case 3:
f.Filter = "Excel file(*.xls)|*.xls";
if (f.ShowDialog() == DialogResult.OK)
{
repd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Excel, f.FileName);
result = true;
}
break;
default:
MessageBox.Show("Không chọn đúng loại.");
break;
}
return result;
}
示例7: SaveReportFile
/// <summary>
/// Сохранить отчет
/// </summary>
/// <param name="path">Путь к папке, куда надо сохранить отчет</param>
/// <param name="reportFileName">Имя отчета</param>
/// <param name="reportFileExtension">Расширение отчета</param>
public void SaveReportFile(string path, string reportFileName, string reportFileExtension)
{
CheckDataSource();
var pathToFile = Path.Combine(path, reportFileName + "." + reportFileExtension);
ReportDocument report = new ReportDocument();
string pathToReportTemplate = Path.Combine(PATH_TO_REPORTS_TEMPLATES, _reportTemplateName + ".rpt");
report.Load(pathToReportTemplate);
report.SetDataSource(_dataSource as DataSet);
report.ExportToDisk(GetExportFormatType(reportFileExtension), pathToFile);
}
示例8: ATBReportForm_Load
private void ATBReportForm_Load(object sender, EventArgs e)
{
ReportDocument cryRpt;
this.debtors_summaryTableAdapter1.Fill(this.dataSet21.debtors_summary);
this.customerTableAdapter1.Fill(this.dataSet21.customer);
ATBReport rpt = new ATBReport();
rpt.SetDataSource(this.dataSet21);
rpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
cryRpt = new ReportDocument();
cryRpt.Load(rpt.FileName.ToString());
cryRpt.SetDataSource(dataSet21);
cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, ReportFolder.reportFolderName + @"\AgedTrialBalance.pdf");
}
示例9: SalesProdReportForm_Load
private void SalesProdReportForm_Load(object sender, EventArgs e)
{
this.configurationTableAdapter.Fill(this.dataSet2.configuration);
runCreateSummaryTable();
ReportDocument cryRpt;
productSalesReportTableAdapter.Fill(this.dataSet2.ProductSalesReport);
SalesProdReport rpt = new SalesProdReport();
rpt.SetDataSource(dataSet2);
cryRpt = new ReportDocument();
cryRpt.Load(rpt.FileName.ToString());
cryRpt.SetDataSource(dataSet2);
cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, ReportFolder.reportFolderName + @"\ProductSalesDetails.pdf");
}
示例10: StatementReportForm_Load
private void StatementReportForm_Load(object sender, EventArgs e)
{
ReportDocument cryRpt;
this.customer_transTableAdapter1.FillBy1(this.dataSet2.customer_trans);
this.customerTableAdapter1.Fill(this.dataSet2.customer);
this.configurationTableAdapter1.Fill(this.dataSet2.configuration);
this.debtors_summaryTableAdapter1.Fill(this.dataSet2.debtors_summary);
StatementsReport rpt = new StatementsReport();
rpt.SetDataSource(this.dataSet2);
cryRpt = new ReportDocument();
cryRpt.Load(rpt.FileName.ToString());
cryRpt.SetDataSource(dataSet2);
cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, ReportFolder.reportFolderName + @"\Statements.pdf");
}
示例11: VietBaoCao
public string VietBaoCao()
{
ReportDocument rd = new ReportDocument();
if (Loaibaocao == "Thống kê chi")
{
string path = Directory.GetCurrentDirectory() + @"\Thống kê chi";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
try
{
rd.Load(Directory.GetCurrentDirectory()+ @"\CrystalReportThongKeDoanhThu.rpt");
rd.SetDataSource(DALThongKeDoanhThu.ListSachChi(Tungay, Denngay));
path = path + @"\" + Mota + ".pdf";
rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, path);
return path;
}
catch
{
return path = "";
}
}
else
{
string path = Directory.GetCurrentDirectory() + @"\Thống kê thu";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
try
{
rd.Load(Directory.GetCurrentDirectory() + @"\REPORT\CrystalReportThongKeThu.rpt");
rd.SetDataSource(DALThongKeDoanhThu.ListSachthu(Tungay, Denngay));
path = path + @"\" + Mota + ".pdf";
rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, path);
return path;
}
catch { return path = ""; }
}
}
示例12: ThongKeSachBan
public string ThongKeSachBan()
{
ReportDocument rd = new ReportDocument();
string path = Directory.GetCurrentDirectory() + @"\Thống kê sách bán được";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
try
{
rd.Load(Directory.GetCurrentDirectory() + @"\REPORT\CrystalReportThongKeBanDuoc.rpt");
rd.SetDataSource(DALThongKeSachBanDuoc.ThongKe(Madaily, Tungay, Denngay));
path = path + @"\" + Motafile + ".pdf";
rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, path);
return path;
}
catch
{
return path = "";
}
}
示例13: VietBaoCao
public string VietBaoCao()
{
ReportDocument rd = new ReportDocument();
string path = Directory.GetCurrentDirectory() + @"\Thống kê tồn kho";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
try
{
rd.Load(Directory.GetCurrentDirectory() + @"\REPORT\CrystalReportThongKeTonKho.rpt");
rd.SetDataSource(DALThongKeTonKho.ThongKe(Tungay, Denngay));
path = path + @"\" + Mota + ".pdf";
rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, path);
return path;
}
catch
{
return path = "";
}
}
示例14: ReceiptAndAdjReportForm_Load
private void ReceiptAndAdjReportForm_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet2.PaymentAdjustRpt' table. You can move, or remove it, as needed.
this.paymentAdjustRptTableAdapter.Fill(this.dataSet2.PaymentAdjustRpt);
// TODO: This line of code loads data into the 'dataSet2.configuration' table. You can move, or remove it, as needed.
this.configurationTableAdapter.Fill(this.dataSet2.configuration);
this.configurationTableAdapter.Fill(this.dataSet2.configuration);
runCreateSummaryTable();
ReportDocument cryRpt;
this.paymentAdjustRptTableAdapter.Fill(this.dataSet2.PaymentAdjustRpt);
ReceiptAndAdjReport rpt = new ReceiptAndAdjReport();
rpt.SetDataSource(dataSet2);
cryRpt = new ReportDocument();
cryRpt.Load(rpt.FileName.ToString());
cryRpt.SetDataSource(dataSet2);
cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, ReportFolder.reportFolderName + @"\ReceiptAndAdjustments.pdf");
}
示例15: SalesSummaryReportForm_Load
private void SalesSummaryReportForm_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet2.ProductSalesSummary' table. You can move, or remove it, as needed.
// DataSet2 dataSet2 = new DataSet2();
// Vectra.DataSet2TableAdapters.configurationTableAdapter configurationTableAdapter1 = new Vectra.DataSet2TableAdapters.configurationTableAdapter();
// Vectra.DataSet2TableAdapters.ProductSalesSummaryTableAdapter ProductSalesSummaryTableAdapter1 = new Vectra.DataSet2TableAdapters.ProductSalesSummaryTableAdapter();
runCreateSummaryTable();
ReportDocument cryRpt;
configurationTableAdapter1.Fill(this.dataSet2.configuration);
productSalesSummaryTableAdapter.Fill(this.dataSet2.ProductSalesSummary);
SalesSummaryReport rpt = new SalesSummaryReport();
rpt.SetDataSource(dataSet2);
cryRpt = new ReportDocument();
cryRpt.Load(rpt.FileName.ToString());
cryRpt.SetDataSource(dataSet2);
cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, ReportFolder.reportFolderName + @"\ProductSalesSummary.pdf");
}