本文整理汇总了C#中ReportDocument类的典型用法代码示例。如果您正苦于以下问题:C# ReportDocument类的具体用法?C# ReportDocument怎么用?C# ReportDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReportDocument类属于命名空间,在下文中一共展示了ReportDocument类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ShowGenericRpt
public void ShowGenericRpt()
{
try
{
bool isValid = true;
string strReportName = System.Web.HttpContext.Current.Session["ReportName"].ToString(); // Setting ReportName
if (string.IsNullOrEmpty(strReportName))
{
isValid = false;
}
if (isValid)
{
ReportDocument rd = new ReportDocument();
string strRptPath = System.Web.HttpContext.Current.Server.MapPath("~/") + "Report//" + strReportName;
rd.Load(strRptPath);
rd.VerifyDatabase();
rd.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "crReport");
// Clear all sessions value
Session["ReportName"] = null;
}
else
{
Response.Write("<H2>Nothing Found; No Report name found</H2>");
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
开发者ID:NguyenHoangDuy,项目名称:MVC_ESM,代码行数:33,代码来源:GenericReportViewerController.cs
示例2: frmReporteTurnosMedico
public frmReporteTurnosMedico(ReportDocument rd)
{
InitializeComponent();
crvForm.ReportSource = rd;
}
开发者ID:pelad0,项目名称:Fenix1.0,代码行数:7,代码来源:frmReporteTurnosMedico.cs
示例3: ErzeugeReport
/// <summary>
/// Erzeugt aus einer CrystalReportsDatei oder einem PDF einen PDF Stream und sendet ihn an den Client
/// </summary>
/// <param name="pin_ReportVorlage">Pfad der Vorlage</param>
/// <param name="pin_ReportAuswahl">reportspezifische Daten</param>
/// <returns>Stream der ein PDF enthält</returns>
public Stream ErzeugeReport(string pin_ReportVorlage, string pin_ReportAuswahl)
{
if (pin_ReportVorlage.Substring(pin_ReportVorlage.LastIndexOf(".") + 1) == "pdf")
{
// Umwandeln des PDF Vordrucks in einen Stream
FileStream Report = new FileStream(Directory.GetCurrentDirectory() + pin_ReportVorlage, System.IO.FileMode.Open, System.IO.FileAccess.Read);
byte[] Buffer = new byte[(int)Report.Length];
Report.Read(Buffer, 0, (int)Report.Length);
Report.Close();
// Versenden der Daten als MemoryStream
System.Windows.Forms.MessageBox.Show("Schicke Raus !!");
return new MemoryStream(Buffer, 0, Buffer.Length);
}
else
{
// Erstellen eines Reports
ReportDocument Report = new ReportDocument();
// Lade Reportvorlage
Report.Load(Directory.GetCurrentDirectory() + pin_ReportVorlage);
// Besondere SELECT Anfrage auf den Datensatz anwenden
if (pin_ReportAuswahl != String.Empty)
Report.DataDefinition.RecordSelectionFormula = pin_ReportAuswahl;
// muss als Stream übertragen werden, da ReportDocuments nicht Serializable sind
return Report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
}
}
开发者ID:BackupTheBerlios,项目名称:pels-svn,代码行数:32,代码来源:PortalLogik_Report.cs
示例4: ExportarPDF
private void ExportarPDF(ReportDocument rep)
{
String ruta_exportacion;
ruta_exportacion = Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["ruta_exportacion_pdf"]);
//ruta_exportacion = System.Configuration.ConfigurationSettings.AppSettings["ruta_exportacion_pdf"];
ExportOptions exportOpts = new ExportOptions();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
exportOpts = rep.ExportOptions;
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = ruta_exportacion + Session.SessionID.ToString() + ".pdf";
exportOpts.DestinationOptions = diskOpts;
rep.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(diskOpts.DiskFileName.ToString());
Response.Flush();
Response.Close();
System.IO.File.Delete(diskOpts.DiskFileName.ToString());
}
开发者ID:yesashii,项目名称:upa,代码行数:27,代码来源:MorosidadCobranza.aspx.cs
示例5: GenerateReport
protected void GenerateReport()
{
System.Console.Beep();
//Create report document
ReportDocument crystalReport = new ReportDocument();
if (txtStart.Text != "" && txtEnd.Text != "" )
{
//Load crystal report made in design view
crystalReport.Load(Server.MapPath("Reports/Notifications.rpt"));
//Set DataBase Login Info
crystalReport.SetDatabaseLogon("root", "123", @"localhost", "nsis");
//Provide parameter values
crystalReport.SetParameterValue("start", txtStart.Text.ToString());
crystalReport.SetParameterValue("end", txtEnd.Text.ToString());
//Set Report in to Report Viewer
crvReportViewer.ReportSource = crystalReport;
}
else
{
// lblError.ForeColor = Color.Red;
// lblError.Text = "Please Provide Valid Details";
}
}
开发者ID:neonmax,项目名称:sims,代码行数:30,代码来源:Sent_Notification_Report.aspx.cs
示例6: btnSearch_Click
private void btnSearch_Click(object sender, EventArgs e)
{
int DoctorID;
DoctorID = Convert.ToInt32(cbDoctor.SelectedValue.ToString());
ReportDocument reportDocument = new ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
string ReportPath = ConfigurationManager.AppSettings["ReportPath"];
paramField.Name = "@DoctorID";
paramDiscreteValue.Value = DoctorID;
reportDocument.Load(ReportPath + "Report\\DoctorCrystalReport.rpt");
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "DB_MedicalShop_02Sept20159PM";
//connectionInfo.UserID = "wms";
//connectionInfo.Password = "wms";
connectionInfo.IntegratedSecurity = true;
SetDBLogonForReport(connectionInfo, reportDocument);
reportDocument.SetParameterValue("@DoctorID", DoctorID);
DoctorCrystalRpt.ReportSource = reportDocument;
DoctorCrystalRpt.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
}
开发者ID:Anshul0305,项目名称:lotas,代码行数:27,代码来源:Form_Doctor_Detail_Report.cs
示例7: cboYear_SelectedIndexChanged
private void cboYear_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
string RepPath;
DataSet dataset = new DataSet();
ReportDocument RepDoc = new ReportDocument();
RepPath = @"D:\Project\Industrial College\Project1\Source23\Source22\Source21\Pazhohesh\Pazhohesh\Main\CrsThesis1.rpt";
RepDoc.Load(RepPath);
objDataAdapter.SelectCommand = new SqlCommand();
SqlConnection objConnection = new SqlConnection("Data Source=User-PC;Initial Catalog=ResearchProje1;Integrated Security=True");
objDataAdapter.SelectCommand.Connection = objConnection;
DataTable objGozaresh = new DataTable();
objGozaresh.Clear();
objDataAdapter.SelectCommand.Parameters.AddWithValue("@DeliveryDate" , cboYear.Text + "%");
objDataAdapter.SelectCommand.CommandText = "Select * from VwThesisGozaresh1 where DeliveryDate Like @DeliveryDate";
objDataAdapter.Fill(objGozaresh);
RepDoc.SetDataSource(objGozaresh);
crystalReportViewer1.ReportSource = RepDoc;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
开发者ID:rad-navid,项目名称:forms-automation,代码行数:25,代码来源:FrmReportThesis.cs
示例8: setParameters
public void setParameters(ReportDocument Rpt)
{
if (HttpContext.Current.Request.QueryString["StartDate"] != null && HttpContext.Current.Request.QueryString["EndDate"] != null)
{
ParameterFields paramFields = new ParameterFields();
ParameterField StartDay, EndDay;
ParameterDiscreteValue dcStartDay, dcEndDay;
StartDay = new ParameterField();
StartDay.ParameterFieldName = "@FromDate";
dcStartDay = new ParameterDiscreteValue();
dcStartDay.Value = Request.QueryString["StartDate"].ToString();
EndDay = new ParameterField();
EndDay.ParameterFieldName = "@ToDate";
dcEndDay = new ParameterDiscreteValue();
dcEndDay.Value = Request.QueryString["EndDate"].ToString();
StartDay.CurrentValues.Add(dcStartDay);
EndDay.CurrentValues.Add(dcEndDay);
paramFields.Add(StartDay);
paramFields.Add(EndDay);
AdminActivityCRViewer.ParameterFieldInfo = paramFields;
AdminActivityCRViewer.ReportSource = Rpt;
AdminActivityCRViewer.DataBind();
}
}
开发者ID:shekar348,项目名称:1PointOne,代码行数:27,代码来源:AdminActivityRpts.aspx.cs
示例9: CriaPDF
protected void CriaPDF()
{
Hashtable hash = (Hashtable)Session["HashVagasDisponivel"];
//CrystalReportViewer_AgendaPrestador.DisplayToolbar = true;
//CrystalReportViewer_AgendaPrestador.EnableDatabaseLogonPrompt = false;
DSRelatorioVagasDisponivel conteudo = new DSRelatorioVagasDisponivel();
conteudo.Tables.Add((DataTable)hash["corpo"]);
ReportDocument repDoc = new ReportDocument();
repDoc.Load(Server.MapPath("RelatoriosCrystal/CrystalReportViewer_VagasDisponivel.rpt"));
repDoc.SetDataSource(conteudo.Tables[1]);
//repDoc.Database.Tables["CabecalhoAgendaPrestador"].SetDataSource((DataTable)hash["cabecalho"]);
//repDoc.Database.Tables["RelatorioAgendaPrestador"].SetDataSource((DataTable)hash["corpo"]);
System.IO.Stream s = repDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "applicattion/octect-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=RelatorioVagasDisponivel.pdf");
Response.AddHeader("Content-Length", s.Length.ToString());
Response.BinaryWrite(((System.IO.MemoryStream)s).ToArray());
Response.End();
}
开发者ID:vivermais,项目名称:vivermais,代码行数:26,代码来源:RelatorioVagas.aspx.cs
示例10: 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;
}
}
开发者ID:manjurul-cse,项目名称:Sales-And-Inventory-System,代码行数:25,代码来源:Form1.cs
示例11: CriaPDF
private void CriaPDF()
{
Hashtable hashtable = (Hashtable)Session["HashAgendaMontadaPublicada"];
DSCabecalhoAgendaMontadaPublicada cabecalho = new DSCabecalhoAgendaMontadaPublicada();
cabecalho.Tables.Add((DataTable)hashtable["cabecalho"]);
DSRelatorioAgendaMontadaPublicada dados = new DSRelatorioAgendaMontadaPublicada();
dados.Tables.Add((DataTable)hashtable["dados"]);
ReportDocument repDoc = new ReportDocument();
repDoc.Load(Server.MapPath("RelatoriosCrystal/CrystalReportViewer_AgendaMontadaPublicada.rpt"));
repDoc.SetDataSource(dados.Tables[1]);
repDoc.Subreports["CrystalReportViewer_CabecalhoAgendaMontadaPublicada.rpt"].SetDataSource(cabecalho.Tables[1]);
System.IO.Stream s = repDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "applicattion/octect-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=RelatorioDeAgendasMontadasPublicadas.pdf");
Response.AddHeader("Content-Length", s.Length.ToString());
Response.BinaryWrite(((System.IO.MemoryStream)s).ToArray());
Response.End();
Session.Remove("HashAgendaMontadaPublicada");
}
开发者ID:vivermais,项目名称:vivermais,代码行数:27,代码来源:RelatorioAgendaMontadaPublicada.aspx.cs
示例12: GenerateWord
private void GenerateWord()
{
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/GeneralLedger.rpt"));
ExportOptions exportop = new ExportOptions();
DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
string strPath = Server.MapPath(@"\retailplus\temp\");
string strFileName = "generalledger_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".doc";
if (System.IO.File.Exists(strPath + strFileName))
System.IO.File.Delete(strPath + strFileName);
dest.DiskFileName = strPath + strFileName;
exportop = rpt.ExportOptions;
SetDataSource(rpt);
exportop.DestinationOptions = dest;
exportop.ExportDestinationType = ExportDestinationType.DiskFile;
exportop.ExportFormatType = ExportFormatType.WordForWindows;
rpt.Export(); rpt.Close(); rpt.Dispose();
fraViewer.Attributes.Add("src","/retailplus/temp/" + strFileName);
}
开发者ID:marioricci,项目名称:erp-luma,代码行数:27,代码来源:_GeneralLedger.ascx.cs
示例13: frminhoadon_Load
private void frminhoadon_Load(object sender, EventArgs e)
{
DataTable ds = hdbus.getHoaDon(KHAIBAO.mabenhnhan, KHAIBAO.ngaykham);
ds.TableName = "HoaDon";
DataTable dt2 = ctkbus.getDonThuoc(KHAIBAO.mabenhnhan + KHAIBAO.ngaykham);
dt2.TableName = "DonThuoc";
DataTable dt3 = cdbus.getCachDung();
dt3.TableName = "CachDung";
DataTable dt4 = ltbus.getLoaiThuoc();
dt4.TableName = "LoaiThuoc";
DataTable dt5 = dvbus.getDonVi();
dt5.TableName = "DonVi";
DataSet dts = new DataSet();
dts.Tables.Add(ds);
dts.Tables.Add(dt2);
dts.Tables.Add(dt3);
dts.Tables.Add(dt4);
dts.Tables.Add(dt5);
if (float.Parse(ds.Rows[0]["TienThuoc"].ToString()) == 0)
{
ReportDocument report = new ReportDocument();
report.Load("..\\..\\inhoadon1.rpt");
report.SetDataSource(dts);
crystalReportViewer.ReportSource = report;
inhoadon1 dt = new inhoadon1();
}
else
{
ReportDocument report = new ReportDocument();
report.Load("..\\..\\inhoadon.rpt");
report.SetDataSource(dts);
crystalReportViewer.ReportSource = report;
inhoadon dt = new inhoadon();
}
}
开发者ID:tuanva90,项目名称:qlphongmach4,代码行数:35,代码来源:frminhoadon.cs
示例14: InitializeLanguage
static void InitializeLanguage(ReportDocument reportDocument)
{
var language = GetCurrentLanguage();
reportDocument.ReportClientDocument.PreferredViewingLocaleID = language;
reportDocument.ReportClientDocument.LocaleID = language;
reportDocument.ReportClientDocument.ProductLocaleID = language;
}
开发者ID:Slesa,项目名称:Playground,代码行数:7,代码来源:MainWindow.xaml.cs
示例15: LoadReportFile
private void LoadReportFile(string rptName, string procName, string rptTitle, Dictionary<string, string> paraValues, Dictionary<string, string> procValues)
{
try
{
string rptPath = Server.MapPath("/ReportPages/" + rptName);
_rptDoc = new ReportDocument();
_rptDoc.Load(rptPath);
_rptDoc.SummaryInfo.ReportTitle = rptTitle;
_rptDoc.SetDataSource(ExcuteQuery(procName, procValues));
if (paraValues.Count > 0)
foreach (KeyValuePair<string, string> par in paraValues)
{
ParameterDiscreteValue pValue = new ParameterDiscreteValue();
pValue.Value = par.Value;
ParameterFieldDefinition pDef = _rptDoc.DataDefinition.ParameterFields[par.Key];
pDef.CurrentValues.Clear();
pDef.CurrentValues.Add(pValue);
pDef.ApplyCurrentValues(pDef.CurrentValues);
}
crystalReportViewer.ReportSource = _rptDoc;
}
catch (Exception e)
{
label.Text = "Report Error: " + e.Message;
}
finally
{
GC.Collect();
}
}
开发者ID:CanhNguyenVan,项目名称:ooad-dev,代码行数:32,代码来源:ReportPage.aspx.cs
示例16: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Session["uname"].ToString();
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(Server.MapPath("SoldProduct.rpt"));
/* ParameterFieldDefinitions PFDS;
ParameterFieldDefinition PFD;
ParameterValues PVS = new ParameterValues();
ParameterDiscreteValue PDV = new ParameterDiscreteValue();
PVS.Clear();
PDV.Value = "";
PFDS = cryRpt.DataDefinition.ParameterFields;
PFD = PFDS["@sDate"];
PVS = PFD.CurrentValues;
//
PVS.Add(PDV);
PFD.ApplyCurrentValues(PVS);
PDV.Value = "";
PFDS = cryRpt.DataDefinition.ParameterFields;
PFD = PFDS["@eDate"];
PVS = PFD.CurrentValues;
//PVS.Clear();
PVS.Add(PDV);
PFD.ApplyCurrentValues(PVS);*/
cryRpt.SetDatabaseLogon("sa", "123", "server", "auction");
CrystalReportViewer1.ReportSource = cryRpt;
CrystalReportViewer1.RefreshReport();
}
开发者ID:Dashboard-X,项目名称:EcommercePortals,代码行数:31,代码来源:SoldProduct.aspx.cs
示例17: 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();
}
}
开发者ID:ArquitecturaSoftware,项目名称:texfinadev,代码行数:32,代码来源:FrnMuestrasEtiqueta_rpt.cs
示例18: ExportReport
public ActionResult ExportReport()
{
List<Investment> allInvestment = new List<Investment>();
using (efarmingEntities dc = new efarmingEntities())
{
allInvestment = dc.Investments.ToList();
}
ReportDocument rd = new ReportDocument();
rd.Load(Path.Combine(Server.MapPath("~/Reports"), "rpt_InvestmentList.rpt"));
rd.SetDataSource(allInvestment);
Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
try
{
Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
stream.Seek(0, SeekOrigin.Begin);
return File(stream, "application/pdf", "InvestmentList.pdf");
}
catch (Exception)
{
throw;
}
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-CrystalReports,代码行数:29,代码来源:HomeController.cs
示例19: FrmProjectReportViewer_Load
private void FrmProjectReportViewer_Load(object sender, EventArgs e)
{
try
{
if (FrmFlagProject.ProjectFlag == 0)
{
lblProjectFlag.Text = "لیست طرح های پژوهشی در دست اجرا در سال" + " " + FrmFlagProject.year;
}
else if (FrmFlagProject.ProjectFlag == 1)
{
lblProjectFlag.Text = "لیست طرح های پژوهشی پایان یافته در سال" + " " + FrmFlagProject.year;
}
DataSet dataset = new DataSet();
ReportDocument RepDoc = new ReportDocument();
string dir = Environment.CurrentDirectory;
dir = dir + "\\CrtMainProject.rpt";
RepDoc.Load(dir);
RepDoc.SetDataSource(FrmFlagProject.objTbl);
crystalReportViewer1.ReportSource = RepDoc;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
开发者ID:rad-navid,项目名称:forms-automation,代码行数:25,代码来源:FrmProjectReportViewer.cs
示例20: GetSalesCenterListByActivationStatus
public ReportDocument GetSalesCenterListByActivationStatus(string sortedBy, string sortingOrder, string isActive, LumexDBPlayer db)
{
try
{
LumexSessionManager.Add("rptName", "Sales_Center_List");
ReportDocument reportDocument = new ReportDocument();
db.AddParameters("@SortedBy", sortedBy.Trim());
db.AddParameters("@SortingOrder", sortingOrder.Trim());
db.AddParameters("@IsActive", isActive.Trim());
if (isActive == "All")
{
reportDocument.Load(reportPath + "GET_SALES_CENTERS.rpt");
}
else
{
reportDocument.Load(reportPath + "GET_SALES_CENTERS_BY_ACTIVATION_STATUS.rpt");
}
reportDocument.SetDataSource(db.ExecuteDataTable("REPORT_GET_SALES_CENTERS_BY_ACTIVATION_STATUS", true));
return reportDocument;
}
catch (Exception)
{
throw;
}
}
开发者ID:atiburrahman09,项目名称:Signbd,代码行数:29,代码来源:GeneralReportsDAL.cs
注:本文中的ReportDocument类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论