public ReportWarning[] CreateReport(string filename, string destination, bool overwrite, byte[] definition, string properties) { Warning[] warnings; webserviceProxy.CreateReport(Path.GetFileName(filename), destination, overwrite, definition, null, out warnings); return(warnings != null?Array.ConvertAll(warnings, ConvertSPWarningToReportWarning) : null); }
/// <summary> /// Create report on the server /// </summary> /// <param name="filename">file to upload</param> /// <param name="destination">folder on the report server to upload</param> /// <param name="overwrite">overwrite existing items</param> public void UploadItem(string filename, string destination, bool overwrite) { Warning[] warnings = null; try { FileStream stream = File.OpenRead(filename); Byte[] definition = new Byte[stream.Length]; stream.Read(definition, 0, (int)stream.Length); stream.Close(); rs.CreateReport(Path.GetFileName(filename), destination, overwrite, definition, null, out warnings); toolStripStatusLabel.Text = String.Format("Uploaded report {0}", Path.GetFileName(filename)); Application.DoEvents(); } catch (Exception ex) { MessageBox.Show(String.Format("An error has occured: {0}", ex.Message)); } }