diff --git a/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs b/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs
index edd22e6f62..e1cbeca0ec 100644
--- a/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs
@@ -116,7 +116,6 @@ namespace SharpReport{
if (base.ConnectionObject == null) {
base.ConnectionObject = this.BuildConnectionObject(model.ReportSettings);
}
- System.Console.WriteLine("BuildRenderer ok");
return base.AbstractRenderer(model);
}
@@ -319,15 +318,18 @@ namespace SharpReport{
#endregion
+
+
+ #region Preview
+
public AbstractRenderer GetRenderer (ReportModel model) {
+ System.Console.WriteLine("Manager.GetRenderer");
if (model == null) {
throw new ArgumentException("SharpReportManager:GetRenderer 'ReportModel'");
}
return this.BuildRenderer (model);
}
- #region Preview
-
///
/// Run Preview with Designer
///
@@ -335,8 +337,9 @@ namespace SharpReport{
///
public void ReportPreview (ReportModel model,bool showInUserControl) {
try {
- System.Console.WriteLine("--------------------");
+ System.Console.WriteLine("");
System.Console.WriteLine("Manager:ReportPreview");
+ System.Console.WriteLine("");
AbstractRenderer abstr = this.BuildRenderer (model);
if (abstr != null) {
@@ -358,10 +361,10 @@ namespace SharpReport{
DataTable dataTable,
bool showInUserControl) {
try {
-
+ System.Console.WriteLine("PreviewPushData with {0} Rows in Table",dataTable.Rows.Count);
AbstractRenderer abstr = base.SetupPushDataRenderer(model,dataTable);
- try {
- if (abstr != null) {
+
+ if (abstr != null) {
if (abstr.Cancel == false) {
if (showInUserControl){
PreviewControl.ShowPreviewWithUserControl (abstr,1.5);
@@ -370,11 +373,6 @@ namespace SharpReport{
}
}
}
- } catch (Exception e) {
- MessageBox.Show("bb " + e.Message);
- }
-
-
} catch (Exception) {
throw;
diff --git a/src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs b/src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs
index 0b4eff7340..24e99e119b 100644
--- a/src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs
@@ -111,12 +111,9 @@ namespace SharpReport.Visitors {
try {
rpt = designableFactory.Create(ctrlElem.GetAttribute("type"));
BaseReportItem br = (BaseReportItem)rpt;
-// br.SuspendLayout();
br.Parent = baseSection;
baseSection.Items.Add (rpt);
XmlHelper.BuildControl (xmlFormReader,ctrlElem,br);
-// br.Visible = true;
-// br.ResumeLayout();
}
catch (Exception ) {
string s = String.Format ("Unable to create <{0}>",ctrlElem.GetAttribute("type").ToString());
diff --git a/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportView.cs b/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportView.cs
index 1b449810dd..6526b774f3 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportView.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportView.cs
@@ -201,21 +201,27 @@ namespace SharpReportAddin{
#region Preview handling
- private void RunPreview() {
+
+
+ private void RunPreview(bool standAlone) {
base.OnSaving(EventArgs.Empty);
- System.Console.WriteLine("View:RunPreview {0}",designerControl.ReportModel.ReportSettings.DataModel);
+
+ System.Console.WriteLine("View:RunPreview for <{0}>",designerControl.ReportModel.ReportSettings.DataModel);
try {
switch (designerControl.ReportModel.ReportSettings.DataModel) {
case GlobalEnums.enmPushPullModel.FormSheet : {
- PreviewStandartReport();
+ System.Console.WriteLine("\tFormSheet");
+ PreviewStandartReport(standAlone);
break;
}
case GlobalEnums.enmPushPullModel.PullData:{
- PreviewStandartReport();
+ System.Console.WriteLine("\tPullData");
+ PreviewStandartReport(standAlone);
break;
}
case GlobalEnums.enmPushPullModel.PushData:{
- PreviewPushReport ();
+ System.Console.WriteLine("\tPushData");
+ PreviewPushReport (standAlone);
break;
}
default:
@@ -230,7 +236,8 @@ namespace SharpReportAddin{
- private void PreviewPushReport (){
+ private void PreviewPushReport (bool standAlone){
+ System.Console.WriteLine("View:PreviewPushDataReport");
try {
using (OpenFileDialog openFileDialog = new OpenFileDialog()){
openFileDialog.Filter = GlobalValues.XsdFileFilter;
@@ -243,7 +250,7 @@ namespace SharpReportAddin{
ds.ReadXml (openFileDialog.FileName);
reportManager.ReportPreviewPushData(designerControl.ReportModel,
ds.Tables[0],
- true);
+ standAlone);
}
}
}
@@ -253,14 +260,14 @@ namespace SharpReportAddin{
}
- private void PreviewStandartReport(){
- System.Console.WriteLine("View:PreviewStadartreport");
+ private void PreviewStandartReport(bool standAlone){
+ System.Console.WriteLine("View:PreviewStandartReport");
reportManager.NoData -= new SharpReportEventHandler (OnNoDataForReport);
reportManager.NoData += new SharpReportEventHandler (OnNoDataForReport);
reportManager.ParametersRequest -= new SharpReportParametersEventHandler (OnParametersRequest);
reportManager.ParametersRequest += new SharpReportParametersEventHandler (OnParametersRequest);
- reportManager.ReportPreview (designerControl.ReportModel, true);
+ reportManager.ReportPreview (designerControl.ReportModel, standAlone);
}
@@ -302,6 +309,8 @@ namespace SharpReportAddin{
private void OnTabPageChanged (object sender, EventArgs e) {
string name = Path.GetFileName (base.FileName);
base.TitleName = name + "[" + tabControl.SelectedTab.Text + "]";
+ System.Console.WriteLine("");
+ System.Console.WriteLine("!! OnTabPageChange !!");
switch (tabControl.SelectedIndex) {
case 0 :
break;
@@ -310,7 +319,7 @@ namespace SharpReportAddin{
if (tabControl.SelectedTab.Controls.Count == 0 ){
tabControl.SelectedTab.Controls.Add(reportManager.PreviewControl);
}
- RunPreview();
+ RunPreview(true);
this.previewPage.Visible = true;
break;
default:
@@ -378,8 +387,11 @@ namespace SharpReportAddin{
reportManager.ParametersRequest -= new SharpReportParametersEventHandler (OnParametersRequest);
reportManager.ParametersRequest += new SharpReportParametersEventHandler (OnParametersRequest);
base.OnSaving(EventArgs.Empty);
- reportManager.ReportPreview (designerControl.ReportModel,
- false);
+ System.Console.WriteLine("");
+ System.Console.WriteLine("!! OnPreviewClick !!");
+// reportManager.ReportPreview (designerControl.ReportModel,
+// false);
+ this.RunPreview(false);
}
@@ -548,6 +560,12 @@ namespace SharpReportAddin{
#region ICSharpCode.SharpDevelop.Gui.IPrintable interface implementation
public System.Drawing.Printing.PrintDocument PrintDocument {
get {
+ System.Console.WriteLine("");
+ System.Console.WriteLine("!! PrintDocument !!");
+
+ if (this.designerControl.ReportModel.ReportSettings.DataModel == GlobalEnums.enmPushPullModel.PushData) {
+ MessageService.ShowMessage("PushModel currently not supported");
+ }
AbstractRenderer renderer = reportManager.GetRenderer(this.designerControl.ReportModel);
return renderer.ReportDocument;
}
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseSettings.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseSettings.cs
index 0677370a9a..3bb951f0fb 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/BaseSettings.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/BaseSettings.cs
@@ -35,7 +35,7 @@ using System.Xml.Serialization;
namespace SharpReportCore {
public class BaseSettings : object {
private const string defaultReportName = "SharpReport1";
-// private const string defaultFileName = "SharpReport1.srd";
+
private string reportName;
private string fileName;
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs
index 55dbd81438..96558c6c5a 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs
@@ -79,6 +79,7 @@ namespace SharpReportCore {
public DataManager(DataTable dataSource, ReportSettings reportSettings){
try {
+ System.Console.WriteLine("DataManager (table,model");
CheckAndSetReportSettings(reportSettings);
CheckAndSetSource(dataSource);
this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource,
@@ -130,10 +131,14 @@ namespace SharpReportCore {
if (settings == null) {
throw new ArgumentNullException("DataManager:ReportSettings");
}
-
+System.Console.WriteLine("CheckAndSetReportSettings");
try {
- SqlQueryCkecker check = new SqlQueryCkecker();
- check.Check(settings.CommandText);
+ System.Console.WriteLine("\t {0}",settings.DataModel.ToString());
+ if (settings.DataModel != GlobalEnums.enmPushPullModel.PushData) {
+ SqlQueryCkecker check = new SqlQueryCkecker();
+ check.Check(settings.CommandText);
+ }
+
} catch (Exception e) {
MessageBox.Show (e.Message);
throw e;
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs
index cb0343d498..cc7b2394a9 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs
@@ -27,17 +27,19 @@ namespace SharpReportCore
}
public void Check (string queryString) {
- this.queryString = queryString.ToUpper(CultureInfo.CurrentCulture);
-
- if (this.queryString.IndexOf (this.UPDATE) > -1) {
- string str = String.Format("{0} is no valid Member of SqlString",this.UPDATE);
- this.Invalid (this.UPDATE);
- }
-
- if (this.queryString.IndexOf(this.DELETE) > -1) {
- this.Invalid (this.DELETE);
- string str = String.Format("{0} is no valid Member of SqlString",this.DELETE);
+ if (queryString != "") {
+ this.queryString = queryString.ToUpper(CultureInfo.CurrentCulture);
+
+ if (this.queryString.IndexOf (this.UPDATE) > -1) {
+ string str = String.Format("{0} is no valid Member of SqlString",this.UPDATE);
+ this.Invalid (this.UPDATE);
+ }
+ if (this.queryString.IndexOf(this.DELETE) > -1) {
+ this.Invalid (this.DELETE);
+ string str = String.Format("{0} is no valid Member of SqlString",this.DELETE);
+
+ }
}
}
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
index c1ba059bfb..c3e84cca99 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
@@ -54,8 +54,7 @@ namespace SharpReportCore {
public AbstractRenderer(ReportModel model){
- System.Console.WriteLine("");
- System.Console.WriteLine("\t\t ABSTRACT RENDERER");
+// System.Console.WriteLine("\tConstructor of ABstractRenderer");
this.reportSettings = model.ReportSettings;
this.sections = model.SectionCollection;
Init();
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs
index a36d846b8c..350eb1b5fd 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs
@@ -60,7 +60,7 @@ namespace SharpReportCore {
}
protected override void ReportBegin(object sender, ReportPageEventArgs e) {
- System.Console.WriteLine("\t\tRenderDataReport:ReportBegin");
+ System.Console.WriteLine("\tRenderDataReport:ReportBegin");
base.ReportBegin (sender,e);
//allways reset the dataManager before printing
if (this.dataManager != null) {
@@ -180,15 +180,7 @@ namespace SharpReportCore {
return "RenderDataReport";
}
#endregion
- public DataManager DatManager {
-// public DataContainer DataContainer {
- get {
- return dataManager;
- }
- set {
- dataManager = value;
- }
- }
+
}
}
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/ReportDocument.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/ReportDocument.cs
index 5b32ca4fac..16bfb92e9f 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/ReportDocument.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/Printing/ReportDocument.cs
@@ -36,7 +36,7 @@ namespace SharpReportCore {
public ReportDocument():base() {
- System.Console.WriteLine("ReportDocument COnstructor");
+ System.Console.WriteLine("ReportDocument Constructor");
base.BeginPrint += new PrintEventHandler (ReportDocumentBeginPrint);
base.PrintPage += new PrintPageEventHandler (ReportDocumentPrintPage);
@@ -46,7 +46,7 @@ namespace SharpReportCore {
}
void GeneratePage (SharpReportCore.ReportPageEventArgs page) {
- System.Console.WriteLine("GeneratePage");
+ System.Console.WriteLine("\tGeneratePage");
if (PrintPageBegin != null) {
PrintPageBegin (this,page);
}
@@ -74,19 +74,19 @@ namespace SharpReportCore {
#region events
//this events are also used by PrintPreviewControl
public void ReportDocumentBeginPrint (object sender,PrintEventArgs e) {
- System.Console.WriteLine("\tReportDocumentBeginPrint");
+ System.Console.WriteLine("\tReportDocument BeginPrint");
pageNr = 0;
}
public void ReportDocumentQueryPage (object sender, QueryPageSettingsEventArgs e) {
- System.Console.WriteLine("\tReportDocumentQueryPage");
+// System.Console.WriteLine("\tReportDocument QueryPage");
if (QueryPage != null) {
QueryPage (this,e);
}
}
public void ReportDocumentPrintPage (object sender, PrintPageEventArgs e) {
- System.Console.WriteLine("\tReportDocumentPrintPage");
+// System.Console.WriteLine("\tReportDocument PrintPage");
pageNr ++;
ReportPageEventArgs pea = new ReportPageEventArgs (e,pageNr,false,new PointF (0,0));
@@ -110,7 +110,7 @@ namespace SharpReportCore {
}
public void ReportDocumentEndPrint (object sender,PrintEventArgs e) {
- System.Console.WriteLine("\tReportDocumentEndPrint");
+// System.Console.WriteLine("\tReportDocument EndPrint");
pageNr = 0;
if (ReportEnd != null) {
ReportEnd (this,null);
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/ReportModel.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/ReportModel.cs
index b26b197829..fe82249658 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/ReportModel.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/ReportModel.cs
@@ -52,6 +52,10 @@ namespace SharpReportCore {
reportSettings.GraphicsUnit = graphicsUnit;
}
+ #region ReportType
+
+ ##endregion
+
#region SharpReport.DelegatesInterfaces.IModel interface implementation
public void Accept(IModelVisitor visitor) {
visitor.Visit (this);
diff --git a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs
index 9983ab0c6c..1729e5dda6 100644
--- a/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs
+++ b/src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs
@@ -233,19 +233,25 @@ namespace SharpReportCore {
protected SharpReportCore.AbstractRenderer SetupPushDataRenderer (ReportModel model,
- DataTable dataTable) {
+ DataTable dataTable) {
+ System.Console.WriteLine("SetupPushDataRenderer with {0}",dataTable.Rows.Count);
+
if (model.ReportSettings.ReportType != GlobalEnums.enmReportType.DataReport) {
- throw new ArgumentException("PrepareForPushDataReport No valid ReportModel");
+ throw new ArgumentException("SetupPushDataRenderer ");
}
if (model.ReportSettings.DataModel != GlobalEnums.enmPushPullModel.PushData) {
- throw new ArgumentException("PrepareForPushDataReport No valid ReportType");
+ throw new ArgumentException("SetupPushDataRenderer ");
}
+
AbstractRenderer abstr = null;
DataManager dataManager = new DataManager (dataTable,model.ReportSettings);
- dataManager.DataBind();
-
+ System.Console.WriteLine("\tDataManager ok = {0}",(dataManager != null));
if (dataManager != null) {
- abstr = new RendererFactory().Create (model,dataManager);
+ dataManager.DataBind();
+ if (dataManager.DataSource != null) {
+ abstr = new RendererFactory().Create (model,dataManager);
+ }
+
return abstr;
}
return null;