below xml is for image output purpose, there is no any issue on output image using xml code below for me.
public static void TIF(Document dc, SortedList<string, object> dcIndexes)
{
string str1 = dcIndexes["Document,name"].ToString();
string str2 = dcIndexes["Document,age"].ToString();
string str5 = dcIndexes["Document,status"].ToString();
string str3 = Path.Combine(Config.OutputFolder, DateTime.Now.ToString("yyyyMMdd"));
if (!Directory.Exists(str3))
Directory.CreateDirectory(str3);
string str4 = Path.Combine(str3, str1 + "_" + str2 + "_" + str5 + ".tif");
DocumentHistory dh = (DocumentHistory) null;
string sourceFileName = ServiceES.FromSE(dc, out dh);
if (File.Exists(str4))
File.Delete(str4);
File.Move(sourceFileName, str4);
PTrace.LogInformation("{0} - TIF - {1}", (object) dc.Title, (object) str4);
}
the output path now is \YYYYMMDD\NAME_AGE_STATUS.tif
if "name" is empty, image name will become: \YYYYMMDD\_AGE_STATUS.tif
the issue i having now is, there are same age and status within the database. the image will just replace over write the first image follow by second and third image, end up only 1 image.
may i know how can i add a running number behind ?
example: \YYYYMMDD\_AGE_STATUS.tif (first image)
, \YYYYMMDD\_AGE_STATUS_001.tif (second image)
follow by \YYYYMMDD\_AGE_STATUS_002.tif (third image).
if can remove the "_" front of AGE will look better.
example:
\YYYYMMDD\AGE_STATUS_002.tif`
its seem because of code below not allow:
if (File.Exists(str4))
File.Delete(str4);
how can i add a sequence number 001,002,003 behind if its duplicate tif ? 10 of file name now duplicated.
_23_Single
_23_Single
_23_Single
_23_Single
_23_Single
_23_Single
_23_Single
_23_Single
_23_Single
_23_Single
to become:
_23_Single
_23_Single_001
_23_Single_002
_23_Single_003
_23_Single_004
_23_Single_005
_23_Single_006
_23_Single_007
_23_Single_008
_23_Single_009
or to become:
23_Single
23_Single_001
23_Single_002
23_Single_003
23_Single_004
23_Single_005
23_Single_006
23_Single_007
23_Single_008
23_Single_009