Select all - Ctrl + A
Copy with header - Ctrl + Shift + C
To set the date time on date field:
alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS';
// Colors
$blue: #007bff !default; // primary
$indigo: #6610f2 !default;
$purple: #6f42c1 !default;
$pink: #e83e8c !default;
$red: #dc3545 !default; // danger
$orange: #fd7e14 !default;
$yellow: #ffc107 !default; // warning
$green: #28a745 !default; // success
$teal: #20c997 !default;
$cyan: #17a2b8 !default; // info
// Grays
$white: #fff !default;
$gray-100: #f8f9fa !default; // light
$gray-200: #e9ecef !default;
$gray-300: #dee2e6 !default;
$gray-400: #ced4da !default;
$gray-500: #adb5bd !default;
$gray-600: #868e96 !default; // secondary
$gray-700: #495057 !default;
$gray-800: #343a40 !default; // dark
$gray-900: #212529 !default;
$black: #000 !default;
net user [userid]/domain
private static void DeleteFile(string FilePath)
{
try
{
using (ListWS.Lists listService = new ListWS.Lists())
{
listService.Url = ListURL;
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
listService.Credentials = new System.Net.NetworkCredential(username, password);
//Get the file id
string fileName = FilePath.Substring(FilePath.LastIndexOf("/") + 1);
string DocID = GetDocID(fileName);
//get guid
string lListName = "EDMS";
XmlNode lSharePointListName = listService.GetList(lListName);
string lListID = lSharePointListName.Attributes["ID"].Value;
XmlDocument doc = new XmlDocument();
//Perform deletion
string xmlCommand;
doc = new XmlDocument();
//ID is the ID field value of MyFolder element
xmlCommand = "<Method ID='1' Cmd='Delete'><Field Name='ID'>" + DocID + "</Field><Field Name='FileRef'>" +
FilePath.Replace("%20"," ") + "</Field></Method>";
XmlElement ele = doc.CreateElement("Batch");
ele.SetAttribute("OnError", "Continue");
ele.SetAttribute("ListVersion", "1");
//ele.SetAttribute("RootFolder", FilePath.Substring(0, FilePath.LastIndexOf("/")));
ele.InnerXml = xmlCommand;
XmlNode node1 = listService.UpdateListItems(lListID, ele);
if ((node1 != null) && (node1.InnerText == SUCCESS))
{
Console.WriteLine("SUCCESS");
}
else
{
Console.WriteLine("There is an error : " + node1.InnerText);
}
}
}
catch (Exception ex)
{
throw ex;
}
}
private static bool MoveEDMSToEDMSR(ISDAFaxDBO faxObj, string EDMSPath, string EDMSRPath, string msg ="")
{
using (CopyWS.Copy copyService = new CopyWS.Copy())
{
copyService.Url = CopyURL;
copyService.Credentials = System.Net.CredentialCache.DefaultCredentials;
copyService.Credentials = new System.Net.NetworkCredential(username, password);
CopyWS.FieldInformation fiEDMS = new CopyWS.FieldInformation();
CopyWS.FieldInformation[] fi = { fiEDMS };
byte[] byteArr;
uint getFile = copyService.GetItem(EDMSPath, out fi, out byteArr);
string[] destination = { EDMSRPath };
CopyWS.CopyResult cResult1 = new CopyWS.CopyResult();
CopyWS.CopyResult cResult2 = new CopyWS.CopyResult();
CopyWS.CopyResult[] cResultArray = { cResult1, cResult2 };
CopyWS.FieldInformation fiRecordDate = new CopyWS.FieldInformation();
fiRecordDate.DisplayName = "Record Date";
fiRecordDate.Type = CopyWS.FieldType.DateTime;
fiRecordDate.Value = faxObj.MaturityDate.ToString("yyyy/MM/ddT00:00:00Z");
CopyWS.FieldInformation fiSector = new CopyWS.FieldInformation();
fiSector.DisplayName = "Sector";
fiSector.Type = CopyWS.FieldType.Choice;
fiSector.Value = "Fax";
CopyWS.FieldInformation[] fis = { fiRecordDate, fiSector };
uint copyresult = copyService.CopyIntoItems(EDMSPath, destination, fis, byteArr, out cResultArray);
//Array.Resize<CopyWS.FieldInformation>(ref fi, fi.Length + 2);
//fi[fi.Length - 2] = fiRecordDate;
//fi[fi.Length - 1] = fiSector;
//uint copyresult = copyService.CopyIntoItems(EDMSPath, destination, fi, byteArr, out cResultArray);
if (copyresult == 0)
{
int idx = 0;
foreach (CopyWS.CopyResult myCopyResult in cResultArray)
{
string opString = (idx + 1).ToString();
if (cResultArray[idx].ErrorMessage == null)
{
msg += "Copy operation " + opString +
"completed.\r\n" + "Destination: " +
cResultArray[idx].DestinationUrl;
}
else
{
msg += "Copy operation " + opString +
" failed.\r\n" + "Error: " +
cResultArray[idx].ErrorMessage + "\r\n" +
"Code: " + cResultArray[idx].ErrorCode;
}
idx++;
}
return true;
}
else
{
return false;
}
}
}
char[] separator = ("/").ToCharArray();
string[] folder = EDMSRPath.Substring(EDMSRPath.IndexOf("ListName") + ("ListName").Length + 1).Split(separator);
//check first folder
// This method is separated to avoid getting the subfolders for all top folders, as it will have too much recurrence.
getFolders(string.Empty, ref dt);
string firstFolder = WSPath + "/ListName";
if (!checkFolderExist(dt, firstFolder + "/" + folder[0]))
{
CreateFolder(firstFolder, folder[0]);
}
firstFolder += "/" + folder[0];
//check the subfolders required
dt = new DataTable();
if (folder.Length > 1)
{
getFolders(folder[0], ref dt, true);
string subfolder = firstFolder;
for (int i = 1; i < folder.Length; i++)
{
if (!checkFolderExist(dt, subfolder + "/" + folder[i]))
{
CreateFolder(subfolder, folder[i]);
}
subfolder += "/" + folder[i];
}
}
Now the actual functions private static bool checkFolderExist(DataTable dt, string folderpath)
{
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Rows[i][0].ToString() == folderpath || dt.Rows[i][0].ToString() == folderpath.Replace(" ","%20"))
{
return true;
}
}
}
return false;
}
And function to create the folder private static string CreateFolder(string path, string foldername)
{
string res = string.Empty;
try
{
using (ListWS.Lists listService = new ListWS.Lists())
{
listService.Url = ListURL;
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
listService.Credentials = new System.Net.NetworkCredential(username, password);
XmlDocument doc = new XmlDocument();
string xmlCommand = "<Batch OnError='Continue' RootFolder='" + path +
"'><Method ID='1' Cmd='New'><Field Name='ID'>New</Field><Field Name='FSObjType'>1</Field><Field Name='BaseName'>" +
foldername + "</Field></Method></Batch>";
doc.LoadXml(xmlCommand);
XmlNode batchNode = doc.SelectSingleNode("//Batch");
XmlNode node1 = listService.UpdateListItems("ListName", batchNode);
if ((node1 != null) && (node1.FirstChild.FirstChild.InnerText == FOLDER_EXISTS) || (node1.FirstChild.FirstChild.InnerText == SUCCESS))
{
// success
res = "";
}
else
{
res = "Create new folder failed for: " + foldername + ". Error Details: " + node1.InnerText;
}
}
}
catch (Exception ex)
{
if (ex.Message != "Column name 'ID' is defined for different mapping types.")
throw ex;
}
return res;
}
private static bool saveFileInEDMS(ISDAFaxDBO faxObj, string localPath, string EDMSPath)
{
using (CopyWS.Copy copyService = new CopyWS.Copy())
{
copyService.Url = CopyURL;
copyService.Credentials = System.Net.CredentialCache.DefaultCredentials;
copyService.Credentials = new System.Net.NetworkCredential(username, password);
string[] destination = { EDMSPath };
CopyWS.CopyResult cResult1 = new CopyWS.CopyResult();
CopyWS.CopyResult cResult2 = new CopyWS.CopyResult();
CopyWS.CopyResult[] cResultArray = { cResult1, cResult2 };
CopyWS.FieldInformation fiRecordDate = new CopyWS.FieldInformation();
fiRecordDate.DisplayName = "Date";
fiRecordDate.Type = CopyWS.FieldType.DateTime;
fiRecordDate.Value = faxObj.MaturityDate.ToString("yyyy/MM/ddT00:00:00Z");
CopyWS.FieldInformation[] fis = { fiRecordDate };
FileStream strm = new FileStream(localPath, FileMode.Open, FileAccess.Read);
Byte[] fileContents = new Byte[strm.Length];
int ia = strm.Read(fileContents, 0, Convert.ToInt32(strm.Length));
strm.Close();
uint copyresult = copyService.CopyIntoItems(localPath, destination, fis, fileContents, out cResultArray);
if (copyresult == 0)
{
return true;
}
else
{
return false;
}
}
}
private static string GetDocID(string docname)
{
try
{
string result="";
using (ListWS.Lists listService = new ListWS.Lists())
{
listService.Url = ListURL;
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
listService.Credentials = new System.Net.NetworkCredential(username, password);
XmlDocument doc = new XmlDocument();
XmlElement query = doc.CreateElement("Query");
XmlElement viewFields = doc.CreateElement("ViewFields");
XmlElement queryOptions = doc.CreateElement("QueryOptions");
//query.InnerXml = "<Where><Gt><FieldRef Name=\"ID\" />" +
// "<Value Type=\"Counter\">0</Value></Gt></Where>";
//docname = "STAR.BE_CIS_B_My%20%20test%20123.pdf";
query.InnerXml = "<Where><Eq><FieldRef Name=\"LinkFilename\" />" +
"<Value Type=\"Text\">"+ docname.Replace("%20"," ") + "</Value></Eq></Where>";
//query.InnerXml = "<Where><BeginsWith><FieldRef Name=\"LinkFilename\" />" +
// "<Value Type=\"Text\">S</Value></BeginsWith></Where>";
viewFields.InnerXml = "";
queryOptions.InnerXml = "<ViewAttributes Scope='Recursive'/>";
XmlNode nodes = listService.GetListItems("ListName", String.Empty, query, viewFields, string.Empty, queryOptions, null);
foreach (System.Xml.XmlNode node in nodes)
{
if (node.Name == "rs:data")
{
for (int i = 0; i < node.ChildNodes.Count; i++)
{
if (node.ChildNodes[i].Name == "z:row")
{
for (int j = 0; j < node.ChildNodes[i].Attributes.Count; j++)
{
Console.WriteLine(j + "|" + node.ChildNodes[i].Attributes[j].Name + "|" + node.ChildNodes[i].Attributes[j].Value);
}
result = node.ChildNodes[i].Attributes["ows_ID"].Value;
}
}
}
}
}
return result;
}
catch (Exception ex)
{
throw ex;
}
}
<style>.test {
writing-mode:tb-rl;
-webkit-transform:rotate(90deg);
-moz-transform:rotate(90deg);
-o-transform: rotate(90deg);
}
</style>
<p class="test">testing 12123123</p>
Result: