Initial commit
This commit is contained in:
18
Reporting/Reporting.aspx
Normal file
18
Reporting/Reporting.aspx
Normal file
@@ -0,0 +1,18 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="True" CodeBehind="Reporting.aspx.cs" Inherits="QW2021C.Reporting.Reporting" %>
|
||||
<%@ Register Assembly="Syncfusion.EJ.Web, Version=18.3460.0.35, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Web" TagPrefix="ej" %>
|
||||
<%@ Register Assembly="Syncfusion.EJ, Version=18.3460.0.35, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Models" TagPrefix="ej" %>
|
||||
|
||||
<%@ Register assembly="FastReport.Web" namespace="FastReport.Web" tagprefix="cc1" %>
|
||||
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="Server">
|
||||
|
||||
<asp:Label runat="server"><h4>Auswertung</h4></asp:Label>
|
||||
<div>
|
||||
<cc1:WebReport ID="WebReport1" runat="server"
|
||||
Width="100%" height="500px" BorderStyle="Solid" BorderWidth="1px" PdfAuthor="qw"
|
||||
PdfEmbeddingFonts="False" PdfProducer="FastReport" ShowExports="True"
|
||||
ShowOdsExport="False" ShowOdtExport="False" ShowPdfExport="True" ShowDbfExport="false" ShowExcel2007Export="False" ShowMhtExport="false"
|
||||
ShowPowerPoint2007Export="False" ShowRtfExport="False" ShowTextExport="False"
|
||||
ShowWord2007Export="False" ShowXmlExcelExport="False" ShowXpsExport="False" ToolbarStyle="Small" OnStartReport="WebReport_StartReport" />
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
47
Reporting/Reporting.aspx.cs
Normal file
47
Reporting/Reporting.aspx.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace QW2021C.Reporting
|
||||
{
|
||||
public partial class Reporting : System.Web.UI.Page
|
||||
{
|
||||
Helper.Log log = new Helper.Log();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (Page.IsPostBack==false)
|
||||
{
|
||||
|
||||
log.insert_entry(2, Convert.ToInt32(Session["UserID"]), "Report: " + Session["xmldata"].ToString());
|
||||
show_report(Session["Reportname"].ToString(), Session["xmldata"].ToString());
|
||||
//show_report(Session["Reportname"].ToString(), Session["xmldata"].ToString());
|
||||
//show_report(Session["Reportname"].ToString(), Session["xmldata"].ToString());
|
||||
WebReport1.Visible = true;
|
||||
WebReport1.Zoom = 1;
|
||||
log.insert_entry(2, Convert.ToInt32(Session["UserID"]), "Report erstellt");
|
||||
}
|
||||
}
|
||||
|
||||
public void show_report(string reportname, string xmldata)
|
||||
{
|
||||
DataSet ds = new DataSet();
|
||||
ds.ReadXml(Server.MapPath("~/Downloads") + "\\" + xmldata);
|
||||
ds.Tables[0].TableName = "Daten";
|
||||
WebReport1.ReportFile = Server.MapPath("~/Reports") + "\\" + reportname;
|
||||
WebReport1.RegisterData(ds);
|
||||
WebReport1.DataBind();
|
||||
WebReport1.Prepare();
|
||||
//WebReport.Report.RegisterData(ds);
|
||||
}
|
||||
|
||||
protected void WebReport_StartReport(object sender, EventArgs e)
|
||||
{
|
||||
WebReport1.Report.SetParameterValue("Param1", Session["Vereinnr"].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Reporting/Reporting.aspx.designer.cs
generated
Normal file
26
Reporting/Reporting.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <automatisch generiert>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
//
|
||||
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code neu generiert wird.
|
||||
// </automatisch generiert>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace QW2021C.Reporting
|
||||
{
|
||||
|
||||
|
||||
public partial class Reporting
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// WebReport1-Steuerelement
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Automatisch generiertes Feld
|
||||
/// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
|
||||
/// </remarks>
|
||||
protected global::FastReport.Web.WebReport WebReport1;
|
||||
}
|
||||
}
|
||||
17
Reporting/rdlc.aspx
Normal file
17
Reporting/rdlc.aspx
Normal file
@@ -0,0 +1,17 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="rdlc.aspx.cs" Inherits="QW2021C.Reporting.rdlc" %>
|
||||
<%@ Register assembly="CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
|
||||
|
||||
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="Server">
|
||||
|
||||
<CR:CrystalReportViewer ID="CrystalReportViewer1"
|
||||
runat="server" AutoDataBind="True"
|
||||
Height="1039px"
|
||||
ReportSourceID="CrystalReportSource1"
|
||||
Width="901px" />
|
||||
<CR:CrystalReportSource ID="CrystalReportSource1"
|
||||
runat="server">
|
||||
<%-- <Report FileName="~/Reports/CrystalReport1.rpt">
|
||||
</Report>--%>
|
||||
</CR:CrystalReportSource>
|
||||
|
||||
</asp:Content>
|
||||
116
Reporting/rdlc.aspx.cs
Normal file
116
Reporting/rdlc.aspx.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using CrystalDecisions.CrystalReports.Engine;
|
||||
using CrystalDecisions.ReportSource;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
|
||||
namespace QW2021C.Reporting
|
||||
{
|
||||
public partial class rdlc : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Init(object sender, EventArgs e)
|
||||
{
|
||||
DataSet ds = new DataSet();
|
||||
ds.ReadXml(Server.MapPath("~\\Workdir\\Daten.xml"));
|
||||
string ortliste = "";
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
if (ortliste != "") ortliste = ortliste + ";";
|
||||
ortliste = ortliste + dr[0].ToString();
|
||||
|
||||
}
|
||||
|
||||
DataTable dt = new DataTable();
|
||||
foreach (DataColumn c in ds.Tables[1].Columns)
|
||||
{
|
||||
if (c.ColumnName.ToString() == "Rang" || c.ColumnName.ToString() == "BestPunkte")
|
||||
{
|
||||
dt.Columns.Add(c.ColumnName, System.Type.GetType("System.Int32"));
|
||||
}
|
||||
else
|
||||
{
|
||||
dt.Columns.Add(c.ColumnName);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (DataRow dr in ds.Tables[1].Rows)
|
||||
{
|
||||
dt.ImportRow(dr);
|
||||
}
|
||||
|
||||
//DataSet dsnew = new DataSet();
|
||||
//dsnew.Tables.Add(dt.Copy());
|
||||
//dsnew.WriteXml(Server.MapPath("~\\workdir\\daten.xml"));
|
||||
|
||||
string[] splitter = ortliste.Split(';');
|
||||
string rptfilename = Server.MapPath("~\\Resultate\\Reports\\Rpt_Auswertung_Gesamt.rpt");
|
||||
ReportDocument cr = new ReportDocument();
|
||||
cr.Load(rptfilename);
|
||||
//cr.SetDatabaseLogon("sa", "*shu29", "shu00", "qw2021");
|
||||
//rystalReportViewer1.ReportSource = cr;
|
||||
//return;
|
||||
int i;
|
||||
for (i = 1; i <= 8; i++)
|
||||
{
|
||||
CrystalDecisions.CrystalReports.Engine.TextObject MyTextObject;
|
||||
MyTextObject = cr.ReportDefinition.ReportObjects["Text" + i.ToString()] as TextObject;
|
||||
MyTextObject.Text = "";
|
||||
try
|
||||
{
|
||||
MyTextObject.Text = splitter[i - 1].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
cr.SetDataSource(dt);
|
||||
CrystalReportViewer1.ReportSource = cr;
|
||||
CrystalReportViewer1.RefreshReport();
|
||||
|
||||
CrystalDecisions.Shared.ConnectionInfo ci = new CrystalDecisions.Shared.ConnectionInfo();
|
||||
//ci.ServerName = Server.MapPath("~\\workdir\\reportdata.xml");
|
||||
//ci.DatabaseName = "_data";
|
||||
//ci.UserID = "";
|
||||
//ci.Password = "";
|
||||
//CrystalDecisions.Shared.TableLogOnInfo tl = new CrystalDecisions.Shared.TableLogOnInfo();
|
||||
//foreach (CrystalDecisions.CrystalReports.Engine.Table t in cr.Database.Tables)
|
||||
//{
|
||||
// t.LogOnInfo.ConnectionInfo = ci;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
//cr.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.CrystalReport, Server.MapPath("~\\Workdir\\output.rpt"));
|
||||
//ReportDocument cr1 = new ReportDocument();
|
||||
//cr.Load(Server.MapPath("~\\Workdir\\output.rpt"));
|
||||
//Session.Add("rptdoc", cr);
|
||||
//CrystalReportViewer1.ReportSource = Session["rptdoc"];
|
||||
|
||||
|
||||
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (Page.IsPostBack == true) return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//private TextObject TextObject()
|
||||
//{
|
||||
// throw new NotImplementedException();
|
||||
//}
|
||||
|
||||
//ReportDocument cryRpt = new ReportDocument();
|
||||
//cryRpt.Load(Server.MapPath("~\\Reports\\CrystalReport1.rpt"));
|
||||
// CrystalReportViewer1.ReportSource = cryRpt;
|
||||
//}
|
||||
|
||||
}
|
||||
35
Reporting/rdlc.aspx.designer.cs
generated
Normal file
35
Reporting/rdlc.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,35 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <automatisch generiert>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
//
|
||||
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code neu generiert wird.
|
||||
// </automatisch generiert>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace QW2021C.Reporting
|
||||
{
|
||||
|
||||
|
||||
public partial class rdlc
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// CrystalReportViewer1-Steuerelement
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Automatisch generiertes Feld
|
||||
/// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
|
||||
/// </remarks>
|
||||
protected global::CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
|
||||
|
||||
/// <summary>
|
||||
/// CrystalReportSource1-Steuerelement
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Automatisch generiertes Feld
|
||||
/// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
|
||||
/// </remarks>
|
||||
protected global::CrystalDecisions.Web.CrystalReportSource CrystalReportSource1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user