Browse Source

Folder's are set correctly from ReportWizard

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1039 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 20 years ago
parent
commit
40e7a2e3ea
  1. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs
  2. 7
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs
  3. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs
  4. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs
  5. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs
  6. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs
  7. 52
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs
  8. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListHandling/SharpArrayList.cs
  9. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs
  10. 12
      src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs
  11. 8
      src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/AbstractReportGenerator.cs
  12. 19
      src/AddIns/Misc/SharpReport/SharpReportWizard/ReportGenerator.cs
  13. 4
      src/AddIns/Misc/SharpReport/SharpReportWizard/ReportLayouts/TableLayout.cs
  14. 29
      src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs
  15. 16
      src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PullModelPanel.cs
  16. 6
      src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PushModelPanel.cs
  17. 8
      src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs

@ -48,7 +48,7 @@ namespace SharpReportCore {
string formattedString = base.FireFormatOutput(this.dbValue,this.FormatString,""); string formattedString = base.FireFormatOutput(this.dbValue,this.FormatString,"");
RectangleF rect = base.PrepareRectangle (e,formattedString); RectangleF rect = base.PrepareRectangle (e,formattedString);
base.PrintTheStuff (e,formattedString,rect); base.PrintTheStuff (e,formattedString,rect);
base.OnAfterPrint (e.LocationAfterDraw); base.NotiyfyAfterPrint (e.LocationAfterDraw);
} }
public override string ToString() { public override string ToString() {

7
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportObject.cs

@ -167,7 +167,6 @@ namespace SharpReportCore {
} }
set { set {
size = value; size = value;
// NotifyPropertyChanged ("Size",true);
NotifyPropertyChanged ("Size"); NotifyPropertyChanged ("Size");
} }
} }
@ -192,14 +191,14 @@ namespace SharpReportCore {
} }
} }
public void OnAfterPrint (PointF afterPrint) { public void NotiyfyAfterPrint (PointF afterPrintLocation) {
if (this.AfterPrinting != null) { if (this.AfterPrinting != null) {
AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrint); AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrintLocation);
AfterPrinting(this, rea); AfterPrinting(this, rea);
} }
} }
public void OnBeforePrint () { public void NotifyBeforePrint () {
if (this.BeforePrinting != null) { if (this.BeforePrinting != null) {
BeforePrinting (this,EventArgs.Empty); BeforePrinting (this,EventArgs.Empty);
} }

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs

@ -37,7 +37,7 @@ namespace SharpReportCore {
base.Render(rpea); base.Render(rpea);
RectangleF rect = PrepareRectangle (rpea,this.Text); RectangleF rect = PrepareRectangle (rpea,this.Text);
PrintTheStuff (rpea,this.Text,rect); PrintTheStuff (rpea,this.Text,rect);
base.OnAfterPrint (rpea.LocationAfterDraw); base.NotiyfyAfterPrint (rpea.LocationAfterDraw);
} }
public override string ToString() { public override string ToString() {

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs

@ -48,7 +48,7 @@ namespace SharpReportCore {
rect, rect,
fmt); fmt);
base.OnAfterPrint (e.LocationAfterDraw); base.NotiyfyAfterPrint (e.LocationAfterDraw);
} }
public override string ToString() { public override string ToString() {

2
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs

@ -46,7 +46,7 @@ namespace SharpReportCore {
fmt); fmt);
// goon // goon
base.OnAfterPrint (e.LocationAfterDraw); base.NotiyfyAfterPrint (e.LocationAfterDraw);
} }
public override string ToString() { public override string ToString() {

6
src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs

@ -124,7 +124,8 @@ namespace SharpReportCore{
public BaseReportObject Find (string columnName) { public BaseReportObject Find (string columnName) {
for (int i = 0;i < this.Count ; i ++) { for (int i = 0;i < this.Count ; i ++) {
BaseReportObject col = this[i]; BaseReportObject col = this[i];
if (String.Compare(col.Name,columnName)== 0){ if (String.Compare(col.Name.ToLower(CultureInfo.CurrentCulture),
columnName.ToLower(CultureInfo.CurrentCulture))== 0){
return col; return col;
} }
} }
@ -149,7 +150,8 @@ namespace SharpReportCore{
public AbstractColumn Find (string columnName) { public AbstractColumn Find (string columnName) {
for (int i = 0;i < this.Count ; i ++) { for (int i = 0;i < this.Count ; i ++) {
AbstractColumn col = (AbstractColumn)this[i]; AbstractColumn col = (AbstractColumn)this[i];
if (String.Compare(col.ColumnName,columnName)== 0){ if (String.Compare(col.ColumnName.ToLower(CultureInfo.CurrentCulture),
columnName.ToLower(CultureInfo.CurrentCulture))== 0){
return col; return col;
} }
} }

52
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs

@ -14,16 +14,15 @@ using System.Collections;
using System.ComponentModel; using System.ComponentModel;
using System.Globalization; using System.Globalization;
using SharpReportCore; //using SharpReportCore;
using System.Windows.Forms;
/// <summary>
/// <summary> /// This Class is used as a wrapper around Databinding
/// This Class is used as a wrapper around Databinding /// </summary>
/// </summary> /// <remarks>
/// <remarks> /// created by - Forstmeier Peter
/// created by - Forstmeier Peter /// created on - 16.10.2005 14:49:43
/// created on - 16.10.2005 14:49:43 /// </remarks>
/// </remarks>
namespace SharpReportCore { namespace SharpReportCore {
public class DataManager : IDataContainer,IEnumerator,IDisposable { public class DataManager : IDataContainer,IEnumerator,IDisposable {
@ -47,7 +46,7 @@ namespace SharpReportCore {
IDataViewStrategy dataViewStrategy; IDataViewStrategy dataViewStrategy;
// private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1); private ListChangedEventArgs resetList = new ListChangedEventArgs(ListChangedType.Reset,-1,-1);
public event ListChangedEventHandler ListChanged; public event ListChangedEventHandler ListChanged;
public event EventHandler <GroupChangedEventArgs> GroupChanged; public event EventHandler <GroupChangedEventArgs> GroupChanged;
@ -71,7 +70,7 @@ namespace SharpReportCore {
this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource, this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource,
reportSettings); reportSettings);
this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged);
} catch (Exception) { } catch (Exception) {
throw; throw;
} }
@ -80,12 +79,11 @@ namespace SharpReportCore {
public DataManager(DataTable dataSource, ReportSettings reportSettings){ public DataManager(DataTable dataSource, ReportSettings reportSettings){
try { try {
System.Console.WriteLine("DataManager (table,model");
CheckAndSetReportSettings(reportSettings); CheckAndSetReportSettings(reportSettings);
CheckAndSetSource(dataSource); CheckAndSetSource(dataSource);
this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource, this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource,
reportSettings); reportSettings);
this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged);
} catch (Exception) { } catch (Exception) {
throw ; throw ;
} }
@ -105,7 +103,7 @@ namespace SharpReportCore {
CheckAndSetSource(dataSource); CheckAndSetSource(dataSource);
this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource, this.dataViewStrategy = new TableStrategy((DataTable)this.dataSource,
reportSettings); reportSettings);
this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged);
} catch (Exception ) { } catch (Exception ) {
throw ; throw ;
} }
@ -118,7 +116,7 @@ namespace SharpReportCore {
this.dataViewStrategy = new CollectionStrategy ((IList)this.dataSource, this.dataViewStrategy = new CollectionStrategy ((IList)this.dataSource,
this.dataMember, this.dataMember,
reportSettings); reportSettings);
this.dataViewStrategy.ListChanged += new ListChangedEventHandler (OnListChanged); this.dataViewStrategy.ListChanged += new ListChangedEventHandler (NotifyListChanged);
} catch (Exception) { } catch (Exception) {
throw; throw;
} }
@ -132,17 +130,14 @@ namespace SharpReportCore {
if (settings == null) { if (settings == null) {
throw new ArgumentNullException("DataManager:ReportSettings"); throw new ArgumentNullException("DataManager:ReportSettings");
} }
System.Console.WriteLine("CheckAndSetReportSettings");
try { try {
System.Console.WriteLine("\t {0}",settings.DataModel.ToString());
if (settings.DataModel != GlobalEnums.enmPushPullModel.PushData) { if (settings.DataModel != GlobalEnums.enmPushPullModel.PushData) {
SqlQueryCkecker check = new SqlQueryCkecker(); SqlQueryCkecker check = new SqlQueryCkecker();
check.Check(settings.CommandText); check.Check(settings.CommandText);
} }
} catch (Exception e) { } catch (Exception) {
MessageBox.Show (e.Message); throw;
throw ;
} }
this.reportSettings = settings; this.reportSettings = settings;
@ -150,11 +145,10 @@ System.Console.WriteLine("CheckAndSetReportSettings");
void CheckAndSetSource(object source) { void CheckAndSetSource(object source) {
System.Console.WriteLine("CheckAndSetSource");
if (source == null) { if (source == null) {
throw new MissingDataSourceException(); throw new MissingDataSourceException();
} }
if (source is IList ||source is IListSource || source is IBindingList) { if (source is IList ||source is IListSource || source is IBindingList) {
//DataTable //DataTable
this.dataSource = source; this.dataSource = source;
@ -202,9 +196,7 @@ System.Console.WriteLine("CheckAndSetReportSettings");
} }
void CheckConnection (ConnectionObject connectionObject) { void CheckConnection (ConnectionObject connectionObject) {
System.Console.WriteLine("CheckOnnection");
try { try {
connection = connectionObject.Connection; connection = connectionObject.Connection;
if (connection.State == ConnectionState.Open) { if (connection.State == ConnectionState.Open) {
connection.Close(); connection.Close();
@ -217,7 +209,6 @@ System.Console.WriteLine("CheckAndSetReportSettings");
} }
private DataSet FillDataSet() { private DataSet FillDataSet() {
System.Console.WriteLine("FillDataSet");
try { try {
if (this.connection.State == ConnectionState.Closed) { if (this.connection.State == ConnectionState.Closed) {
this.connection.Open(); this.connection.Open();
@ -234,7 +225,7 @@ System.Console.WriteLine("CheckAndSetReportSettings");
DataSet ds = new DataSet(); DataSet ds = new DataSet();
ds.Locale = CultureInfo.CurrentCulture; ds.Locale = CultureInfo.CurrentCulture;
adapter.Fill (ds); adapter.Fill (ds);
System.Console.WriteLine("\t {0} in Table",ds.Tables[0].Rows.Count); // System.Console.WriteLine("\t {0} in Table",ds.Tables[0].Rows.Count);
return ds; return ds;
} catch (Exception) { } catch (Exception) {
throw; throw;
@ -289,13 +280,13 @@ System.Console.WriteLine("CheckAndSetReportSettings");
#region Event Handling #region Event Handling
private void OnListChanged (object sender, ListChangedEventArgs e) { private void NotifyListChanged (object sender, ListChangedEventArgs e) {
if (this.ListChanged != null) { if (this.ListChanged != null) {
this.ListChanged (this,e); this.ListChanged (this,e);
} }
} }
private void OnGroupChange (object sender,GroupChangedEventArgs e) { private void NotifyGroupChange (object sender,GroupChangedEventArgs e) {
if (this.GroupChanged != null) { if (this.GroupChanged != null) {
this.GroupChanged (this,e); this.GroupChanged (this,e);
@ -398,8 +389,9 @@ System.Console.WriteLine("CheckAndSetReportSettings");
public bool DataBind() { public bool DataBind() {
this.dataViewStrategy.Bind(); this.dataViewStrategy.Bind();
this.dataViewStrategy.GroupChanged += new EventHandler <GroupChangedEventArgs>(OnGroupChange); this.dataViewStrategy.GroupChanged += new EventHandler <GroupChangedEventArgs>(NotifyGroupChange);
CheckReportColumns(); CheckReportColumns();
// this.NotifyListChanged (this,this.resetList);
return true; return true;
} }

4
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListHandling/SharpArrayList.cs

@ -4,10 +4,10 @@ using System.Reflection;
using System.Collections; using System.Collections;
using System.ComponentModel; using System.ComponentModel;
using System.Collections.Generic;
namespace SharpReportCore namespace SharpReportCore
{ {
/// <summary>
/// This Class is the BaseClass for all Lists witch handles sorting,grouping etc.
/// </summary> /// </summary>
public class SharpArrayList : ArrayList, IBindingList ,ITypedList,IExtendedList public class SharpArrayList : ArrayList, IBindingList ,ITypedList,IExtendedList

4
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs

@ -12,7 +12,7 @@ using System.Text;
using System.Collections; using System.Collections;
using System.Data; using System.Data;
using System.ComponentModel; using System.ComponentModel;
using System.Windows.Forms;
using SharpReportCore; using SharpReportCore;
namespace SharpReportCore { namespace SharpReportCore {
@ -41,6 +41,7 @@ namespace SharpReportCore {
// MessageBox.Show ("On List Change"); // MessageBox.Show ("On List Change");
// } // }
/*
private string a_BuildSort(ColumnCollection sortCollection){ private string a_BuildSort(ColumnCollection sortCollection){
System.Console.WriteLine("BuildSort"); System.Console.WriteLine("BuildSort");
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -61,6 +62,7 @@ namespace SharpReportCore {
System.Console.WriteLine("\tsort by {0}",sb.ToString()); System.Console.WriteLine("\tsort by {0}",sb.ToString());
return sb.ToString(); return sb.ToString();
} }
*/
#region Building the Index list #region Building the Index list
// if we have no sorting, we build the indexlist as well, so we don't need to // if we have no sorting, we build the indexlist as well, so we don't need to

12
src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs

@ -39,7 +39,7 @@ namespace ReportGenerator{
public class CreateReport : AbstractMenuCommand { public class CreateReport : AbstractMenuCommand {
const string WizardPath = "/ReportGenerator/ReportGeneratorWizard"; const string WizardPath = "/ReportGenerator/ReportGeneratorWizard";
private ReportModel reportModel = null; private ReportModel reportModel;
private Properties customizer = new Properties(); private Properties customizer = new Properties();
@ -77,7 +77,7 @@ namespace ReportGenerator{
void DoCreate (ReportModel model) { void DoCreate (ReportModel model) {
GlobalEnums.enmPushPullModel dataModel; GlobalEnums.enmPushPullModel dataModel;
dataModel = model.ReportSettings.DataModel; dataModel = model.DataModel;
switch (dataModel) { switch (dataModel) {
case GlobalEnums.enmPushPullModel.PullData: case GlobalEnums.enmPushPullModel.PullData:
GeneratePullReport (model); GeneratePullReport (model);
@ -101,7 +101,6 @@ namespace ReportGenerator{
void GeneratePullReport (ReportModel model) { void GeneratePullReport (ReportModel model) {
try { try {
ReportGenerator reportGenerator = (ReportGenerator)customizer.Get("Generator");
GeneratePullDataReport generator = new GeneratePullDataReport(customizer,model); GeneratePullDataReport generator = new GeneratePullDataReport(customizer,model);
if (generator != null) { if (generator != null) {
generator.GenerateReport(); generator.GenerateReport();
@ -119,17 +118,15 @@ namespace ReportGenerator{
/// </summary> /// </summary>
/// <param name="model">ReportModel</param> /// <param name="model">ReportModel</param>
void GeneratePushReport (ReportModel model) { void GeneratePushReport (ReportModel model) {
try { try {
ReportGenerator reportGenerator = (ReportGenerator)customizer.Get("Generator");
GeneratePushDataReport generator = new GeneratePushDataReport(customizer,model); GeneratePushDataReport generator = new GeneratePushDataReport(customizer,model);
if (generator != null) { if (generator != null) {
generator.GenerateReport(); generator.GenerateReport();
} else { } else {
throw new NullReferenceException ("GeneratePullDataReport"); throw new NullReferenceException ("GeneratePullDataReport");
} }
} catch (Exception) { } catch (Exception e) {
throw; throw e;
} }
} }
@ -142,7 +139,6 @@ namespace ReportGenerator{
try { try {
model.ReportSettings.ReportType = GlobalEnums.enmReportType.FormSheet; model.ReportSettings.ReportType = GlobalEnums.enmReportType.FormSheet;
SharpReportManager manager = new SharpReportManager();
} catch (Exception e) { } catch (Exception e) {
throw e; throw e;
} }

8
src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/AbstractReportGenerator.cs

@ -45,7 +45,7 @@ namespace ReportGenerator {
this.customizer = customizer; this.customizer = customizer;
this.reportModel = reportModel; this.reportModel = reportModel;
if (reportModel == null) { if (reportModel == null) {
throw new ArgumentNullException("GeneratePullDataReport: <reportModel"); throw new ArgumentNullException("reportModel");
} }
reportGenerator = (ReportGenerator)customizer.Get("Generator"); reportGenerator = (ReportGenerator)customizer.Get("Generator");
manager = new SharpReportManager(); manager = new SharpReportManager();
@ -63,7 +63,7 @@ namespace ReportGenerator {
//TODO Change these function to using SharpQuery //TODO Change these function to using SharpQuery
protected DataTable GenerateFieldsTable(ReportModel reportModel) { protected DataTable GenerateFieldsTable(ReportModel reportModel) {
if (reportModel == null) { if (reportModel == null) {
throw new ArgumentNullException("AbstractReportGenerator:GenerateFieldsTable No reportModel"); throw new ArgumentNullException("reportModel");
} }
if (reportModel.ReportSettings.ConnectionString.Length == 0) { if (reportModel.ReportSettings.ConnectionString.Length == 0) {
throw new ArgumentException("CreateOLEDB Connection : No ConnectionString"); throw new ArgumentException("CreateOLEDB Connection : No ConnectionString");
@ -108,8 +108,8 @@ namespace ReportGenerator {
} }
} }
} catch (Exception) { } catch (Exception e) {
throw; throw e;
} }
OleDbDataReader reader = null; OleDbDataReader reader = null;
DataTable schemaTable = null; DataTable schemaTable = null;

19
src/AddIns/Misc/SharpReport/SharpReportWizard/ReportGenerator.cs

@ -46,13 +46,13 @@ namespace ReportGenerator {
//Database //Database
private GlobalEnums.enmPushPullModel dataModel; private GlobalEnums.enmPushPullModel dataModel;
private string connectionString = String.Empty; private string connectionString;
private string catalogName = String.Empty; private string catalogName;
private string sqlString = String.Empty; private string sqlString;
private CommandType commandType; private CommandType commandType;
private SharpQueryProcedure sharpQueryProcedure = null; private SharpQueryProcedure sharpQueryProcedure;
private ReportItemCollection reportItemCollection = null; private ReportItemCollection reportItemCollection;
private SharpQuerySchemaClassCollection queryParameters; private SharpQuerySchemaClassCollection queryParameters;
public ReportGenerator() { public ReportGenerator() {
@ -63,15 +63,14 @@ namespace ReportGenerator {
model.ReportSettings.ReportName = this.reportName; model.ReportSettings.ReportName = this.reportName;
model.ReportSettings.FileName = this.path + this.fileName; model.ReportSettings.FileName = this.path + this.fileName;
model.ReportSettings.GraphicsUnit = this.graphicsUnit;
model.ReportSettings.GraphicsUnit = this.graphicsUnit;
model.ReportSettings.ReportType = this.reportType; model.ReportSettings.ReportType = this.reportType;
model.ReportSettings.ConnectionString = this.connectionString; model.ReportSettings.ConnectionString = this.connectionString;
model.ReportSettings.CommandText = this.sqlString;
model.ReportSettings.CommandText = sqlString; model.ReportSettings.CommandType = this.commandType;
model.ReportSettings.CommandType = commandType; model.ReportSettings.DataModel = this.dataModel;
model.ReportSettings.DataModel = dataModel;
return model; return model;
} }

4
src/AddIns/Misc/SharpReport/SharpReportWizard/ReportLayouts/TableLayout.cs

@ -14,13 +14,13 @@ using System.ComponentModel;
using SharpReportCore; using SharpReportCore;
/// <summary> /// <summary>
/// TODO - Add class summary /// This class build a TableLayout
/// </summary> /// </summary>
namespace ReportGenerator { namespace ReportGenerator {
public class TableLayout : AbstractLayout { public class TableLayout : AbstractLayout {
int colWidth = 0; int colWidth;
Font defaultFont; Font defaultFont;
public TableLayout(ReportModel reportModel):base(reportModel) { public TableLayout(ReportModel reportModel):base(reportModel) {

29
src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs

@ -8,10 +8,11 @@
*/ */
using System; using System;
using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Globalization;
//using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
//using System.Windows.Forms.Design;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
@ -42,10 +43,10 @@ namespace ReportGenerator{
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.RadioButton radioFormSheet; private System.Windows.Forms.RadioButton radioFormSheet;
ReportGenerator generator = null; ReportGenerator generator;
Properties customizer = null; Properties customizer;
bool initDone = false; bool initDone;
public BaseSettingsPanel(){ public BaseSettingsPanel(){
InitializeComponent(); InitializeComponent();
@ -121,10 +122,10 @@ namespace ReportGenerator{
generator.ReportName = txtReportName.Text; generator.ReportName = txtReportName.Text;
generator.FileName = txtFileName.Text; generator.FileName = txtFileName.Text;
generator.Path = this.txtPath.Text; generator.Path = this.txtPath.Text;
generator.GraphicsUnit = (GraphicsUnit)Enum.Parse(typeof(GraphicsUnit),this.cboGraphicsUnit.Text); generator.GraphicsUnit = (GraphicsUnit)Enum.Parse(typeof(GraphicsUnit),this.cboGraphicsUnit.Text);
SetSuccessor (this,new EventArgs()); SetSuccessor (this,new EventArgs());
} }
} }
@ -159,11 +160,19 @@ namespace ReportGenerator{
try { try {
ICSharpCode.SharpDevelop.Gui.FolderDialog ff = new ICSharpCode.SharpDevelop.Gui.FolderDialog(); ICSharpCode.SharpDevelop.Gui.FolderDialog ff = new ICSharpCode.SharpDevelop.Gui.FolderDialog();
ff.DisplayDialog(""); ff.DisplayDialog("");
if (ff.Path.Length > 0) { if (!String.IsNullOrEmpty(ff.Path)) {
// this.txtPath.Text = FileUtility.GetDirectoryNameWithSeparator(ff.Path.Trim()); if (!ff.Path.EndsWith(@"\")){
MessageBox.Show("BaseSettingPanel path : " +ff.Path);
this.txtPath.Text = ff.Path; this.txtPath.Text = ff.Path + @"\";
System.Console.WriteLine("added slash");
} else {
this.txtPath.Text = ff.Path;
System.Console.WriteLine("no slash added");
}
generator.Path = this.txtPath.Text;
} }
} catch (Exception ) { } catch (Exception ) {
throw ; throw ;
} }

16
src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PullModelPanel.cs

@ -56,15 +56,15 @@ namespace ReportGenerator
nodeError nodeError
} }
private bool firstDrag = true; private bool firstDrag;
private string connectionString = String.Empty; private string connectionString;
private string catalogName = String.Empty;
private CommandType commandType; private CommandType commandType;
private ReportGenerator generator = null; private ReportGenerator generator;
private Properties customizer = null; private Properties customizer;
private ISharpQueryNode currentNode = null; private ISharpQueryNode currentNode;
public PullModelPanel() public PullModelPanel()
@ -74,6 +74,7 @@ namespace ReportGenerator
base.EnableFinish = false; base.EnableFinish = false;
base.EnableNext = false; base.EnableNext = false;
base.EnableCancel = true; base.EnableCancel = true;
this.firstDrag = true;
commandType = CommandType.Text; commandType = CommandType.Text;
this.txtSqlString.Enabled = false; this.txtSqlString.Enabled = false;
Localise(); Localise();
@ -134,8 +135,6 @@ namespace ReportGenerator
} }
void TxtSqlStringDragDrop(object sender, System.Windows.Forms.DragEventArgs e){ void TxtSqlStringDragDrop(object sender, System.Windows.Forms.DragEventArgs e){
string strDrag = (string)e.Data.GetData(typeof(string));
if (firstDrag == true) { if (firstDrag == true) {
this.txtSqlString.Text = ""; this.txtSqlString.Text = "";
firstDrag = false; firstDrag = false;
@ -204,7 +203,6 @@ namespace ReportGenerator
if (node.Connection.ConnectionString.Length > 0) { if (node.Connection.ConnectionString.Length > 0) {
this.connectionString = node.Connection.ConnectionString; this.connectionString = node.Connection.ConnectionString;
this.catalogName = node.Connection.CatalogName;
this.txtSqlString.Enabled = true; this.txtSqlString.Enabled = true;
if (this.firstDrag) { if (this.firstDrag) {

6
src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/PushModelPanel.cs

@ -35,10 +35,10 @@ namespace ReportGenerator
private System.Windows.Forms.CheckedListBox checkedListBox; private System.Windows.Forms.CheckedListBox checkedListBox;
private System.Windows.Forms.TextBox txtPath; private System.Windows.Forms.TextBox txtPath;
private ReportGenerator generator = null; private ReportGenerator generator;
private Properties customizer = null; private Properties customizer;
private ReportItemCollection colDetail = null; private ReportItemCollection colDetail;
public PushModelPanel(){ public PushModelPanel(){
InitializeComponent(); InitializeComponent();

8
src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs

@ -41,8 +41,8 @@ namespace ReportGenerator{
private System.Windows.Forms.TextBox txtSqlString; private System.Windows.Forms.TextBox txtSqlString;
private System.Windows.Forms.DataGrid grdQuery; private System.Windows.Forms.DataGrid grdQuery;
private ReportGenerator generator = null; private ReportGenerator generator;
private Properties customizer = null; private Properties customizer;
private SharpQuerySchemaClassCollection parametersClass; private SharpQuerySchemaClassCollection parametersClass;
@ -110,8 +110,8 @@ namespace ReportGenerator{
try { try {
// Stored Proc without Parameters // Stored Proc without Parameters
resultDataSet = (DataSet) proc.Execute(0,proc.GetSchemaParameters()); resultDataSet = (DataSet) proc.Execute(0,proc.GetSchemaParameters());
} catch (Exception) { } catch (Exception e) {
throw; throw e;
} }
} }

Loading…
Cancel
Save