pkatanic
3rd November 2015, 17:37
Hello friends,
I write the program which in result print Excel report. I have to name that report in this manner Contractorsddmmyyyy.xls
How to do that? Any suggestions please?
bhushanchanda
3rd November 2015, 18:45
Hi,
Are you programmatically creating the file and transferring it to client machine? If yes, then you can simply put the required file name in destination parameter of server2client()
Also, check this similar thread (http://www.baanboard.com/baanboard/showthread.php?t=13170&highlight=batch+date+file)
pkatanic
5th November 2015, 08:34
Hi, I do not transferring file to client machine. Here my print function
function boolean print.table(){
XADD.WORKSHEET("ss:Name", "Contractors")
xmlWorksheet1=xmlWorksheet
XADD.TABLE()
IF f.extend = tcyesno.yes THEN
XADD.TABLE.COLUMN("ss:Width", "120") | 1
XADD.TABLE.COLUMN("ss:Width", "100") | 2
XADD.TABLE.COLUMN("ss:Width", "90") | 3
XADD.TABLE.COLUMN("ss:Width", "100") | 4
XADD.TABLE.COLUMN("ss:Width", "90") | 5
XADD.TABLE.COLUMN("ss:Width", "90") | 6
ELSE
XADD.TABLE.COLUMN("ss:Width", "120") | 1
XADD.TABLE.COLUMN("ss:Width", "100") | 2
XADD.TABLE.COLUMN("ss:Width", "110") | 3
XADD.TABLE.COLUMN("ss:Width", "90") | 4
XADD.TABLE.COLUMN("ss:Width", "50") | 5
XADD.TABLE.COLUMN("ss:Width", "90") | 6
ENDIF
XADD.TABLE.ROW()
IF f.extend = tcyesno.yes THEN
XADD.CELL.STRING( cp_iso("Только контрагенты с кодом статуса 2 "), "Header", "ss:MergeAcross", "9" ) |&" "&sprintf$("%D(%02d.%02m.%04Y)")
ELSE
XADD.CELL.STRING( cp_iso("Контрагенты "), "Header", "ss:MergeAcross", "9" )|&" "&sprintf$("%D(%02d.%02m.%04Y)")
ENDIF
XADD.TABLE.ROW()
IF f.extend = tcyesno.yes THEN
XADD.CELL.STRING( form.text$("twrpt1475.code"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.naim"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.pnai"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.inn"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.stat"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.deco"), "TableHeader1", "ss:MergeDown", "1")
ELSE
XADD.CELL.STRING( form.text$("twrpt1475.code"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.naim"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.pnai"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.inn"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.stat"), "TableHeader1", "ss:MergeDown", "1")
XADD.CELL.STRING( form.text$("twrpt1475.deco"), "TableHeader1", "ss:MergeDown", "1")
ENDIF
XADD.TABLE.ROW()
XADD.WORKSHEET.OPTIONS()
return (true)
}
mark_h
5th November 2015, 17:03
I am not familiar with the XADD commands - are these commands ending up in an output file on the baan server itself?
bhushanchanda
5th November 2015, 17:59
Even I didn't get it. Are they defined anywhere in the script?
Please post your complete code if possible.
pkatanic
6th November 2015, 10:27
Hello, XADD commands are defined, we have DLL where they are defined. Excuse me if I make confuse with this commands but I just don't have idea how to automatically give name to the Excel file. It's suppose to show contractors and currently file name is the name of session and i have to rename it. On print button Excel openned on local computer, and it's all. Thank you for your patience!
bhushanchanda
6th November 2015, 10:33
Hi,
In that case, you might need to take a look at your DLL. That might be the place where the file is named. As its a custom DLL, its difficult to predict and answer the question. Check the script for the DLL to see how the file is created and then make the logic change accordingly.