Добро пожаловать в форум, Guest  >>   Войти | Регистрация | Поиск | Правила | В избранное | Подписаться
Все форумы / Caché, Ensemble, DeepSee, MiniM, IRIS, GT.M Новый топик    Ответить
Топик располагается на нескольких страницах: [1] 2 3   вперед  Ctrl      все
 Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
Доброго дня всем .

Недавно опять начал заниматься возвратом данных
пользователю в виде json (тему я поднял раньше)
Как можно в Каше возвращать массив при помощью пользовательской функции (типа $$split) ?
В таком виде не работает.
split(str,delim)
  f i=1:1:$l(str,delim) s arr(i)=$p(str,delim,i)
  q arr
  ;; 

Спасибо
5 июл 18, 15:51    [21546477]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
doublefint
Member

Откуда: Беларусь, Минск
Сообщений: 933
Valeriu,
split(str,delim,arr)
  s list = $LFS( str, delim ), pointer = 0, i=0
  while $LISTNEXT( list, pointer, item ) {
   s i = i + 1, arr( i ) = item
  }  
  q $$$OK
  ;; 

Использование
k arr s arr="" 
if split( str, delim, .arr ) {
 zw arr
}
5 июл 18, 17:13    [21546831]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Valeriu
В таком виде не работает.

Нужно передать еще имя переменной локальной или глобальной, куда писать тот массив.

split(Str,Name,Dlm)
	n i
	s:$g(Dlm)="" Dlm=","
	f i=1:1:$l(Str,Dlm) s @Name@(i)=$p(Str,Dlm,i)
	q $g(i)
6 июл 18, 09:05    [21548096]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
Спасибо за отклики.
Что я мог получить, пока только это:
+
brakJson(ip,query) ;
 n $es n $et s $et="g:'$es error"
 s (an,parc,nrbord,rut,dat,ora,lastnode,in,Ret,n,arr)=""
 s data=$p(query,"*",1),parc=$p(query,"*",2),bord=$p(query,"*",3),przn=$p(query,"*",4)
 s j=-1,e=-1
  f  s an=$o(^controlST(an)) q:an=""  d
 . f  s parc=$o(^controlST(an,parc)) q:parc=""  d
 . . f  s nrbord=$o(^controlST(an,parc,nrbord)) q:nrbord=""  d
 . . . f  s rut=$o(^controlST(an,parc,nrbord,rut)) q:rut=""  d
 . . . . f  s ora=$o(^controlST(an,parc,nrbord,rut,ora)) q:ora=""  d
 . . . . . i przn="1.1" s n=n+1,in(ip,n)=an_"\"_parc_"\"_nrbord_"\"_rut_"\"_ora_"\"_$p(^controlST(an,parc,nrbord,rut,ora),"*",1)_$p(^controlST(an,parc,nrbord,rut,ora),"*",2) d
 . . . . . . f i=0:1:$l(in(ip,n),"\")-1 s dummy(i)=$p(in(ip,n),"\",i+1)
 . . . . . . s arr(n)=$$ENCODE^%FCGIJSON("dummy")
 . . . . . i przn="1.2" s n=n+1,in(ip,n)=an_"\"_parc_"\"_nrbord_"\"_rut_"\"_ora_"\"_$p(^controlST(an,parc,nrbord,rut,ora),"*",3) d
 . . . . . . f i=0:1:$l(in(ip,n),"\")-1 s dummy(i)=$p(in(ip,n),"\",i+1)
 . . . . . . s arr(n)=$$ENCODE^%FCGIJSON("dummy")
 . . . . . i przn="1.3" s n=n+1,in(ip,n)=an_"\"_parc_"\"_nrbord_"\"_rut_"\"_ora_"\"_$p(^controlST(an,parc,nrbord,rut,ora),"*",4) d
 . . . . . . f i=0:1:$l(in(ip,n),"\")-1 s dummy(i)=$p(in(ip,n),"\",i+1)
 . . . . . . s arr(n)=$$ENCODE^%FCGIJSON("dummy")
 ; 
 s %fcgi("o","stdout")=$$ENCODE^%FCGIJSON("arr") 
 s %fcgi("o","header","Content-Type")="application/json"
 q
 ;;    

В консоле получаю:
GET http://192.168.1.111:8082/cache/tab/brakJson/192.168.1.5/***1.3
[HTTP/1.1 200 OK 10ms]
{"1":"["20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""]","2":"["20180611","2","2067","1","10.15","","","","","","","","","","","",""]","3":"["20180612","1","1240","10","12.30","","","3.3","3.4","","","","","","","",""]","4":"["20180612","2","2039","4","11.20","","3.2","","","","","","","","","",""]","5":"["20180618","3","3748","23","28.25","3.1","3.2","","","","","","","","","",""]","6":"["20180620","1","1201","10","10.20","3.1","3.2","3.3","3.4","3.5","3.6","3.7","3.8","3.9","3.10","3.11",""]","7":"["20180620","1","1230","22","09.20","","3.2","","","","","","","","","",""]","8":"["20180620","2","2404","8","15.32","","","3.3","","","","","","","","",""]","9":"["20180620","3","3759","7","7.35","","3.2","3.3","","","","","","","","",""]","10":"["20180625","2","2111","4","9.32","","3.2","","3.4","","","","","","","",""]","11":"["20180627","2","2039","5","14.23","","3.2","3.3","","","","","","","","",""]","12":"["20180701","3","3736","23","11.25","","3.2","","","","","","","","","",""]","13":"["20180702","2","2109","4","9.45","","","","","","","","","","","",""]"}

А нужно как-то так:
+
[ ["20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""],
  ["20180611","2","2067","1","10.15","","","","","","","","","","","",""],
  ...
["20180701","3","3736","23","11.25","","3.2","","","","","","","","","",""]","13":"["20180702","2","2109","4","9.45","","","","","","","","","","","",""] ];
6 июл 18, 11:26    [21548775]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Valeriu
А нужно как-то так

Так тебе осталось скобки объекта на скобки массива заменить... И объектовые ключи убрать...
6 июл 18, 14:14    [21549573]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
krvsa,
Загорелся я прямо вот этим:
https://www.supinfo.com/articles/single/1954-ibrairie-jspdf
еще вот(https://simonbengtsson.github.io/jsPDF-AutoTable/)
т.е. использовать jsPDF для создания отчета ...
С таблицами я разобрался вроде, даже самому понравилось.
Вот еще бы это овладеть и полное счастье !!!
Для этого и хочу привести данные в соответствие.
6 июл 18, 14:32    [21549659]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
krvsa,
Хотя получать могу и так:
"["20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""], ["20180611","2","2067","1","10.15","","","","","","","","","","","",""], ["20180612","1","1240","10","12.30","","","3.3","3.4","","","","","","","",""], ["20180612","2","2039","4","11.20","","3.2","","","","","","","","","",""], ["20180618","3","3748","23","28.25","3.1","3.2","","","","","","","","","",""], ["20180620","1","1201","10","10.20","3.1","3.2","3.3","3.4","3.5","3.6","3.7","3.8","3.9","3.10","3.11",""], ["20180620","1","1230","22","09.20","","3.2","","","","","","","","","",""], ["20180620","2","2404","8","15.32","","","3.3","","","","","","","","",""], ["20180620","3","3759","7","7.35","","3.2","3.3","","","","","","","","",""], ["20180625","2","2111","4","9.32","","3.2","","3.4","","","","","","","",""], ["20180627","2","2039","5","14.23","","3.2","3.3","","","","","","","","",""], ["20180701","3","3736","23","11.25","","3.2","","","","","","","","","",""], ["20180702","2","2109","4","9.45","","","","","","","","","","","",""], "
6 июл 18, 14:36    [21549672]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Valeriu
хочу привести данные в соответствие.

Так сам ту строку формируй... Зачем тебе эти кащейские грабли?
6 июл 18, 14:39    [21549686]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Valeriu
Хотя получать могу и так

Вот!
Останется только приклеить скобки массива!
6 июл 18, 14:40    [21549692]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
krvsa,

Может некрасиво, но где-то так :
+
//**** Add brak SPS !!!
function addJson(aa,mm,dd,pp,tt,rr,tb,pz)  {
    // *** Data in textbox
     var AAAA = document.getElementById(aa).value
     var MM = document.getElementById(mm).value
     var DD = document.getElementById(dd).value
     var AMD = AAAA + MM + DD
     var parc = document.getElementById(pp).value
     var nrbord = document.getElementById(tt).value

   var select = prompt('Select pentru generarea tabelului:(Data*Parc*Trolebuz*)', AMD + "*" + parc + "*" + nrbord + "*" + pz);
   //alert('Ati selectat urmatoarele date: ' + select );

   var adrip = document.getElementById("ipnr").value
   var callback = function(req){
   var rtncode = req.responseText;

  instr = rtncode.split('"["').join("[ [");
  finstr = instr.split('], "').join("] ];");
  console.log(finstr);
  };
  AJAX( "GET", "/cache/tab/brakJson/" + adrip + "/" + select, null, callback );
}

В консоле:
+
[ [20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""], ["20180611","2","2067","1","10.15","","","","","","","","","","","",""], ["20180612","1","1240","10","12.30","","","3.3","3.4","","","","","","","",""], ["20180612","2","2039","4","11.20","","3.2","","","","","","","","","",""], ["20180618","3","3748","23","28.25","3.1","3.2","","","","","","","","","",""], ["20180620","1","1201","10","10.20","3.1","3.2","3.3","3.4","3.5","3.6","3.7","3.8","3.9","3.10","3.11",""], ["20180620","1","1230","22","09.20","","3.2","","","","","","","","","",""], ["20180620","2","2404","8","15.32","","","3.3","","","","","","","","",""], ["20180620","3","3759","7","7.35","","3.2","3.3","","","","","","","","",""], ["20180625","2","2111","4","9.32","","3.2","","3.4","","","","","","","",""], ["20180627","2","2039","5","14.23","","3.2","3.3","","","","","","","","",""], ["20180701","3","3736","23","11.25","","3.2","","","","","","","","","",""], ["20180702","2","2109","4","9.45","","","","","","","","","","","",""] ];
6 июл 18, 15:20    [21549913]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Valeriu
Может некрасиво, но где-то так

Дык!

var json = '[ [20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""],["20180611","2","2067","1","10.15","","","","","","","","","","","",""]]';
var parsed = JSON.parse(json);
6 июл 18, 15:47    [21550038]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
krvsa,

Что-то ругается. Видимо неправильно сформировал...
6 июл 18, 16:20    [21550163]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Valeriu
Видимо неправильно сформировал...

Скорее всего... Либо кавычки, либо запятые, а может скобки. Проверяй комплектность. ;)
9 июл 18, 08:03    [21554911]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
krvsa,
Если честно, ничего не понимаю.
Вроде все правильно ...
Если я по отдельности ставлю в тело программы строки json (я их из консоли беру !!!) - Работает !!!
Как только пытаюсь кормить ее данными в целом - НЕТ !!!
Говорит что это не массив ...
На JS:
+
//**** Add brak SPS !!!
function addJson(aa,mm,dd,pp,tt,rr,tb,pz)  {

    // *** Data in textbox
     var AAAA = document.getElementById(aa).value
     var MM = document.getElementById(mm).value
     var DD = document.getElementById(dd).value
     var AMD = AAAA + MM + DD
     var parc = document.getElementById(pp).value
     var nrbord = document.getElementById(tt).value

   var select = prompt('Select pentru generarea tabelului:(Data*Parc*Trolebuz*)', AMD + "*" + parc + "*" + nrbord + "*" + pz);

   var adrip = document.getElementById("ipnr").value
   var callback = function(req){
   var rtncode = req.responseText;

   var instr = rtncode.split('][').join('],[');
   var rows="[" + instr +"];"
   console.log(rows);
   
   var result = Array.isArray(rows);
   alert(result);

   var columns = ["Data", "Parc", "Nr/Brd", "Ruta", "Ora", "LipsaS","LipsaT", "LipsaTr", 
	      	       "LipsaSa", "LipsaD", "LipsaR", "LipsaF", "LipsaTl","LipsaIf", "LipsaIn", "LipsaSb"]; 

  //var rows = [["20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""],
  //            ["20180611","2","2067","1","10.15","","","","","","","","","","","",""]];

var doc = new jsPDF('l', 'pt','a4');
doc.autoTable(columns, rows);
doc.save('table.pdf');

  };

  AJAX( "GET", "/cache/tab/brakJson/" + adrip + "/" + select, null, callback );

}

В консоле:
+
[["20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""],["20180611","2","2067","1","10.15","","","","","","","","","","","",""],["20180612","1","1240","10","12.30","","","3.3","3.4","","","","","","","",""],["20180612","2","2039","4","11.20","","3.2","","","","","","","","","",""],["20180618","3","3748","23","28.25","3.1","3.2","","","","","","","","","",""],["20180620","1","1201","10","10.20","3.1","3.2","3.3","3.4","3.5","3.6","3.7","3.8","3.9","3.10","3.11",""],["20180620","1","1230","22","09.20","","3.2","","","","","","","","","",""],["20180620","2","2404","8","15.32","","","3.3","","","","","","","","",""],["20180620","3","3759","7","7.35","","3.2","3.3","","","","","","","","",""],["20180625","2","2111","4","9.32","","3.2","","3.4","","","","","","","",""],["20180627","2","2039","5","14.23","","3.2","3.3","","","","","","","","",""],["20180701","3","3736","23","11.25","","3.2","","","","","","","","","",""],["20180702","2","2109","4","9.45","","","","","","","","","","","",""]];
9 июл 18, 11:19    [21555408]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
doublefint
Member

Откуда: Беларусь, Минск
Сообщений: 933
Valeriu, уберите точку с запятой ; после закрывающей скобки массива
 var rows="[" + instr +"];" // <- вот тут 

 var rows="[" + instr +"]" // <- должно быть вот так 

И почему бы не сформировать запятые еще на сервере?
 var instr = rtncode.split('][').join('],[') // <- эмм, :\  
9 июл 18, 11:52    [21555561]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
doublefint,

Попробовал и так (убрал) безрезультатно.
На стороне сервера Каше тоже не очень удобно
s arr=arr_$$ENCODE^%FCGIJSON("dummy")_","
- все ровно на JS приходится менять
9 июл 18, 12:04    [21555614]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Valeriu
Если честно, ничего не понимаю.

У меня все работает...

var str='['
str+='["20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""],'
str+='["20180611","2","2067","1","10.15","","","","","","","","","","","",""],'
str+='["20180612","1","1240","10","12.30","","","3.3","3.4","","","","","","","",""],'
str+='["20180612","2","2039","4","11.20","","3.2","","","","","","","","","",""],'
str+='["20180618","3","3748","23","28.25","3.1","3.2","","","","","","","","","",""],'
str+='["20180620","1","1201","10","10.20","3.1","3.2","3.3","3.4","3.5","3.6","3.7","3.8","3.9","3.10","3.11",""],'
str+='["20180620","1","1230","22","09.20","","3.2","","","","","","","","","",""],'
str+='["20180620","2","2404","8","15.32","","","3.3","","","","","","","","",""],'
str+='["20180620","3","3759","7","7.35","","3.2","3.3","","","","","","","","",""],'
str+='["20180625","2","2111","4","9.32","","3.2","","3.4","","","","","","","",""],'
str+='["20180627","2","2039","5","14.23","","3.2","3.3","","","","","","","","",""],'
str+='["20180701","3","3736","23","11.25","","3.2","","","","","","","","","",""],'
str+='["20180702","2","2109","4","9.45","","","","","","","","","","","",""]'
str+=']';
var arr=JSON.parse(str);
alert(arr[0][0]);
9 июл 18, 13:23    [21555983]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
Вот такой примерчик еще...

<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='https://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
$(function(){
	$.ajax({
		url: "tmp1.csp",
		dataType: "json",
		success: function(Data){
			alert(Data[0][0]);
		}
	});
});
</script>
</head>
<body>
</body>
</html>


Содержимое tmp1.csp
[
	["20180605","1","1232","10","12.30","","3.2","","","","","","","","","",""],
	["20180611","2","2067","1","10.15","","","","","","","","","","","",""],
	["20180612","1","1240","10","12.30","","","3.3","3.4","","","","","","","",""],
	["20180612","2","2039","4","11.20","","3.2","","","","","","","","","",""],
	["20180618","3","3748","23","28.25","3.1","3.2","","","","","","","","","",""],
	["20180620","1","1201","10","10.20","3.1","3.2","3.3","3.4","3.5","3.6","3.7","3.8","3.9","3.10","3.11",""],
	["20180620","1","1230","22","09.20","","3.2","","","","","","","","","",""],
	["20180620","2","2404","8","15.32","","","3.3","","","","","","","","",""],
	["20180620","3","3759","7","7.35","","3.2","3.3","","","","","","","","",""],
	["20180625","2","2111","4","9.32","","3.2","","3.4","","","","","","","",""],
	["20180627","2","2039","5","14.23","","3.2","3.3","","","","","","","","",""],
	["20180701","3","3736","23","11.25","","3.2","","","","","","","","","",""],
	["20180702","2","2109","4","9.45","","","","","","","","","","","",""]
]
9 июл 18, 13:35    [21556048]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
Работает.
На стороне Cache:
brakJson(ip,query) ;
 n $es n $et s $et="g:'$es error"
 k Ret
 s (an,parc,nrbord,rut,dat,ora,lastnode,in,Ret,n,arr,cik)=""
 s data=$p(query,"*",1),parc=$p(query,"*",2),bord=$p(query,"*",3),przn=$p(query,"*",4)
  f i=1:1 s an=$o(^controlST(an)) q:an=""  d
 . f  s parc=$o(^controlST(an,parc)) q:parc=""  d
 . . f  s nrbord=$o(^controlST(an,parc,nrbord)) q:nrbord=""  d
 . . . f  s rut=$o(^controlST(an,parc,nrbord,rut)) q:rut=""  d
 . . . . f  s ora=$o(^controlST(an,parc,nrbord,rut,ora)) q:ora=""  d
 . . . . . i przn="1.3" s n=n+1,in(ip,n)=an_"\"_parc_"\"_nrbord_"\"_rut_"\"_ora_"\"_$p(^controlST(an,parc,nrbord,rut,ora),"*",4) d
 . . . . . . f i=0:1:$l(in(ip,n),"\")-1 s dummy(i)=$p(in(ip,n),"\",i+1)
 . . . . . . s arr=arr_$$ENCODE^%FCGIJSON("dummy")
 s %fcgi("o","stdout")=arr ; $$ENCODE^%FCGIJSON("dummy")   
 s %fcgi("o","header","Content-Type")="application/json"
 q
 ;;

На стороне JavaScript(Ajax):
function addJson(aa,mm,dd,pp,tt,rr,tb,pz)  {
    // *** Data in textbox
     var AAAA = document.getElementById(aa).value
     var MM = document.getElementById(mm).value
     var DD = document.getElementById(dd).value
     var AMD = AAAA + MM + DD
     var parc = document.getElementById(pp).value
     var nrbord = document.getElementById(tt).value

   var select = prompt('Select pentru generarea tabelului:(Data*Parc*Trolebuz*)', AMD + "*" + parc + "*" + nrbord + "*" + pz);
   var adrip = document.getElementById("ipnr").value
   var callback = function(req){
   var rtncode = req.responseText;
   console.log(rtncode); 
   var instr = rtncode.split('][').join('],[');
   var outstr="[" + instr +"]"
   var rows = JSON.parse(outstr); // <- вот тут собака была зарыта
   var columns = ["Data", "Parc", "Nr.Brd", "Ruta", "Ora", "LipsaS","LipsaT", "LipsaTr", 
	      	       "LipsaSa", "LipsaD", "LipsaR", "LipsaF", "LipsaTl","LipsaIf", "LipsaIn", "LipsaSb"]; 

	var doc = new jsPDF('l', 'pt','a4');
	doc.autoTable(columns, rows);
	doc.save('table.pdf');
  };
  AJAX( "GET", "/cache/tab/brakJson/" + adrip + "/" + select, null, callback );
}
9 июл 18, 16:26    [21556844]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
kalin
Member

Откуда:
Сообщений: 263
Valeriu,

Вот такое нагромождение "кода-хлама" отваживает программистов изучать Cache.

Все решается гораздо проще более "продвинутым" ПО
9 июл 18, 23:42    [21558031]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
kalin
Member

Откуда:
Сообщений: 263
По простому для примера:
Создается файл формата отчета, в данном случае pdf, который связан с классом "счетов"
<report
id="account_invoices"
model="account.invoice"
string="Счет"
report_type="qweb-pdf"
name="account.report_invoice"
/>
string - автоматически появляется наименование отчета в списке по нажатию клавиши печать на форме счета
Создается сам шаблон отчета:
<template id="report_invoice">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<div class="page">
<h2>Report title</h2>
<p>This object's name is <span t-field="o.name"/></p>
"набор тегов тела счета"
</div>
</t>
</t>
</t>
</template>
web.external_layout - указывает на базовый шаблон внешнего оформления отчета (заголовок, компания, стр. и т.д.)

Вот по сути и весь код для получения PDF счета.
Весь клиентский java код и "движек" отчета скрыт во framework и нет никакой необходимости в нем что-либо менять.
Для настройки формата бумаги при необходимости описывается еще один шаблон.
10 июл 18, 00:16    [21558076]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
kalin
Вот такое нагромождение "кода-хлама" отваживает программистов изучать Cache

Стоп. Все это можно делать на одном М-е (где-то я обсужал это)
и пугаться программистам изучать Cache не надо.
Вам все ровно придется прибегать к вызовам Ajax(в данном конкретном случае) или Node.js ...
Я к чему стремился все это время - единый код для всех М реализаций, будь то Cache или GT.M.
А что пугает программистов ?
Вроде одно, а на самом деле НЕТ. Вот попробуйте приложения для ВЕБ
написанных на Cache вызвать в GT.M, вот тогда все станет ясно.
10 июл 18, 08:23    [21558226]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
kalin
Member

Откуда:
Сообщений: 263
Valeriu,
Вообще-то пора забыть M как таковой. Низкоуровневое программирование - это удел поставщиков framework.
Задача прикладника - получение конечного продукта в наиболее сжатые сроки с использованием встроенных framework.
А "строить" самому низкоуровневый код по выборке данных из глобалей и разборке его на JavaScript - это прошлый век.
10 июл 18, 13:00    [21559042]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
krvsa
Member

Откуда: г Волжский
Сообщений: 13109
kalin
Вот такое нагромождение "кода-хлама" отваживает программистов изучать Cache.

Если будут платить нормально - так покидают "нормальные" ЯП и прибегут к Кащею.
Т.ч. "боязнь" не там, где ты ее ищешь.
11 июл 18, 09:04    [21561226]     Ответить | Цитировать Сообщить модератору
 Re: Пользовательская функция  [new]
Valeriu
Member

Откуда: Chisinau
Сообщений: 2021
kalin
<p>This object's name is <span t-field="o.name"/></p>
"набор тегов тела счета"
</div>

Вот покажите пример в ДИНАМИКУ как из БД(любой)
создать таблицу с данными с этим "продвинутым" ПО
Мне просто интересно.
11 июл 18, 10:34    [21561441]     Ответить | Цитировать Сообщить модератору
Топик располагается на нескольких страницах: [1] 2 3   вперед  Ctrl      все
Все форумы / Caché, Ensemble, DeepSee, MiniM, IRIS, GT.M Ответить