diff --git a/ReportSync.Designer.cs b/ReportSync.Designer.cs index 400b931..af4b37e 100644 --- a/ReportSync.Designer.cs +++ b/ReportSync.Designer.cs @@ -51,6 +51,8 @@ private void InitializeComponent() this.bottomStrip = new System.Windows.Forms.StatusStrip(); this.currentStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.bottomPanel = new System.Windows.Forms.Panel(); + this.lblEncoding = new System.Windows.Forms.Label(); + this.cbEncoding = new System.Windows.Forms.ComboBox(); this.btnUpload = new System.Windows.Forms.Button(); this.txtLocalPath = new System.Windows.Forms.TextBox(); this.lblDest = new System.Windows.Forms.Label(); @@ -256,6 +258,8 @@ private void InitializeComponent() // this.bottomPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.bottomPanel.Controls.Add(this.lblEncoding); + this.bottomPanel.Controls.Add(this.cbEncoding); this.bottomPanel.Controls.Add(this.btnUpload); this.bottomPanel.Controls.Add(this.txtLocalPath); this.bottomPanel.Controls.Add(this.lblDest); @@ -267,6 +271,28 @@ private void InitializeComponent() this.bottomPanel.Size = new System.Drawing.Size(758, 36); this.bottomPanel.TabIndex = 22; // + // lblEncoding + // + this.lblEncoding.AutoSize = true; + this.lblEncoding.Location = new System.Drawing.Point(607, 9); + this.lblEncoding.Name = "lblEncoding"; + this.lblEncoding.Size = new System.Drawing.Size(55, 13); + this.lblEncoding.TabIndex = 23; + this.lblEncoding.Text = "Encoding:"; + // + // cbEncoding + // + this.cbEncoding.FormattingEnabled = true; + this.cbEncoding.Items.AddRange(new object[] { + "Default", + "UTF8"}); + this.cbEncoding.Location = new System.Drawing.Point(668, 6); + this.cbEncoding.Name = "cbEncoding"; + this.cbEncoding.Size = new System.Drawing.Size(75, 21); + this.cbEncoding.TabIndex = 22; + this.cbEncoding.Text = "Default"; + this.cbEncoding.SelectedIndexChanged += new System.EventHandler(this.cbEncoding_SelectedIndexChanged); + // // btnUpload // this.btnUpload.Location = new System.Drawing.Point(378, 6); @@ -835,6 +861,8 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripStatusLabel currentStatus; private System.Windows.Forms.Label lbSourceStatus; private System.Windows.Forms.Label lbDestStatus; + private System.Windows.Forms.ComboBox cbEncoding; + private System.Windows.Forms.Label lblEncoding; } } diff --git a/ReportSync.cs b/ReportSync.cs index 585273c..84ff214 100644 --- a/ReportSync.cs +++ b/ReportSync.cs @@ -24,6 +24,8 @@ public partial class ReportSync : Form private ReportingServicesMgmt _destServicesMgmt; private ReportingServicesMgmt _sourceServicesMgmt; + private string _selectedEncoding = "Default"; + private string _pathOnDisk; private string _uploadPath = RootFolder; @@ -115,6 +117,10 @@ void bwUpload_DoWork(object sender, DoWorkEventArgs e) var report = new XmlDocument(); report.Load(file); var reportDef = Encoding.Default.GetBytes(report.OuterXml); + if (_selectedEncoding.Equals("UTF8")) + { + reportDef = Encoding.UTF8.GetBytes(report.OuterXml); + } if (!_existingPaths.Contains(reportPath)) { EnsureDestDir(reportPath); @@ -625,5 +631,21 @@ private void cbSourceIntegratedAuth_CheckedChanged_1(object sender, EventArgs e) { tbSourceUser.Enabled = tbSourcePassword.Enabled = !cbSourceIntegratedAuth.Checked; } + + private void cbEncoding_SelectedIndexChanged(object sender, EventArgs e) + { + ComboBox comboBox = (ComboBox) sender; + string selectedEncoding = (string)comboBox.SelectedItem; + if (!String.IsNullOrEmpty(selectedEncoding)) + { + _selectedEncoding = selectedEncoding; + } + else + { + _selectedEncoding = "Default"; + } + + } + } }