查找

Question
· Avr 20, 2021

BI Tools and Caché

Hi,

I am testing some BI tools like Tableau, Power BI and Qlik with Caché using ODBC driver

Is there another way to connect them with Caché?

5 Comments
Discussion (5)0
Connectez-vous ou inscrivez-vous pour continuer
Question
· Avr 7, 2021

Add div programmatically to th-element after refreshContents()

Hey community,

I want to create my own table resizer. I know that there are some plugins that are doing exactly this but I would like to create my own one. :)

 

I have created a function, which is called in the onloadHandler and which append a div to each th-element of a given table. The method looks like this:

function initializeTableFeatures(){

    jQuery.each($("#table > table > thead > tr > th"), function() {
         if(this.id !== ""){
              var div createDiv($(this).outerHeight());
              $(this).append($(div));
              $(this).css('position','relative');
              setListeners(div);
              this.width $(this).outerWidth()
              console.log(div)
         }

    });

}

 

The function "createDiv()" does this:

function createDiv(tableHeight){
    var div document.createElement('div');
    $(div).css('top','0');
    $(div).css('right','0');
    $(div).css('width','2px');
    $(div).css('position','absolute');
    $(div).css('cursor','col-resize');
    $(div).css('userSelect','none');
    $(div).css('height',tableHeight 'px');
    return div;
}

This is working perfectly then entering the page. The problem is that the table can be multi-paged. So tthe table is splitted into multiple pages. On each page change the method refreshTable() is called. This method executes refreshContents() on the table.

 

I tried to add my initializeTableFeatures() function after the call of refreshContents(), but it didnt work. I thought that the table isnt fully loaded when calling my initializeTableFeatures(). Due to this I added a setTimeout() for this function but it didnt work either.

 

One funny thing is that when I am adding an alert to the refreshTable() function and I am closing this alert, the div are successfully appended to each th-element.

 

Does anyone know a fix to this problem?

 

Thanks in advance

1 Comment
Discussion (1)0
Connectez-vous ou inscrivez-vous pour continuer
Question
· Avr 7, 2021

how to convert Crystal Reports to Logi/InterSystems Reports

We are looking at moving from Cache to IRIS, if we do this we will want to use Intersystems Reports.  We have a lot of Crystal Reports to convert.  is there a conversion tool or best practice for doing the conversion 

4 Comments
Discussion (4)2
Connectez-vous ou inscrivez-vous pour continuer
Question
· Avr 4, 2021

$zf call out to Window DIR command not working when running concurrent process

I have an application that is called by terminal in local cache environment. The application basically has two processes that runs and does the below call to retrieve files and sub-directories in separate folders.    When the main process starts, it jobs off and calls the second process that gathers all files in a directory by using a window dir and file command that pipes the results to a file.  The main process continues on and does the same thing but from a different folder.  When checking out what was retrieved by the secondprocess, there were directories and files missing.   When I run this as just one process it works properly.    I am running this on a 2017 license cache instance.   I have also tried this on IRIS instance and got the same results.  Could you please advise me what is causing the window directory to not work properly when running the processes at the same time?

Main process one

S FILE=SDIR_"DIRLIST.TXT"

I $$FSIZECK(FILE) S FSIZE=1 Q ""

S X=$ZF(-1,"DEL """_FILE_"""")

S X=$ZF(-1,"DIR """_SDIR_""" >> """_FILE_"""")

 

 

Second process one

S FILE=SDIR_"DIRLIST.TXT"

I $$FSIZECK(FILE) S FSIZE=1 Q ""

S X=$ZF(-1,"DEL """_FILE_"""")

S X=$ZF(-1,"DIR """_SDIR_""" >> """_FILE_"""")

8 Comments
Discussion (8)2
Connectez-vous ou inscrivez-vous pour continuer
Article
· Avr 3, 2021 2m de lecture

Wrap JSON to multi lines / Test ISJSON

install and usage

Packed Pretty.xml installs routine ZPretty in any namespace.
calling $$Do^ZPretty(input,[filler],[newline]) returns a wrapped JSON string.
filler is the optional string for the indent, default = "  "
newline is optional, default = $C(13,10)
input accepts: JSON_String, JSON_Stream, %DynamicAbstractObject

^Pretty leaves all error trapping to you. So can use it as ISJSON check.

Set flat=$$Do^Pretty(input,"","") removes all formatting from input.
this could be useful to compare 2 different formatted JSON_Strings.

examples

 

USER>read jsn
{"Name":"Li,Robert K.","SSN":"672-92-9664","DOB":"1975-01-12","Home":{"Street":"986 Washington Blvd","City":"Boston","State":"PA","Zip":"95802"},"Office":{"Street":"6012 First Place","City":"Reston","State":"MT","Zip":"77739"},"Spouse":{"Name":"Avery,Zelda H.","SSN":"323-13-7437","DOB":"1943-03-27","Home":{"Street":"196 Main Drive","City":"Youngstown","State":"WY","Zip":"53229"},"Office":{"Street":"4056 Franklin Court","City":"Bensonhurst","State":"IA","Zip":"27688"},"FavoriteColors":["Black"],"Age":77},"Age":45,"Title":"Associate Marketing Manager","Salary":10421}
USER>

 

straight to device

 

USER>write $$Do^ZPretty(jsn)
{
  "Name":"Li,Robert K.",
  "SSN":"672-92-9664",
  "DOB":"1975-01-12",
  "Home":{
    "Street":"986 Washington Blvd",
    "City":"Boston",
    "State":"PA",
    "Zip":"95802"
  },
  "Office":{
    "Street":"6012 First Place",
    "City":"Reston",
    "State":"MT",
    "Zip":"77739"
  },
  "Spouse":{
    "Name":"Avery,Zelda H.",
    "SSN":"323-13-7437",
    "DOB":"1943-03-27",
    "Home":{
      "Street":"196 Main Drive",
      "City":"Youngstown",
      "State":"WY",
      "Zip":"53229"
    },
    "Office":{
      "Street":"4056 Franklin Court",
      "City":"Bensonhurst",
      "State":"IA",
      "Zip":"27688"
    },
    "FavoriteColors":[
      "Black"
    ],
    "Age":77
  },
  "Age":45,
  "Title":"Associate Marketing Manager",
  "Salary":10421
}
USER>

 

to string & compare

 

USER>set wrap=$$Do^ZPretty(jsn)
  
USER>write $s(wrap=jsn:"SAME",1:"DIFF")
DIFF
USER>write $s($$Do^ZPretty(wrap,"","")=jsn:"SAME",1:"DIFF")
SAME

 

ISJSON

 

USER>set crap=$replace(wrap,"""Home"":","")  
USER>do Do^ZPretty(crap)
<THROW>%FromJSON+38^%Library.DynamicAbstractObject.1 *%Exception.General Parsing error 3 Line 5 Offset 3

USER>try {do Do^ZPretty(jsn) Write "OK" IF 1} catch er { Write "NO" IF 0 } write !,$test
OK
1
USER>try {do Do^ZPretty(crap) Write "OK" IF 1} catch er { Write "NO" IF 0 } write !,$test
NO
0

GitHub

Discussion (0)0
Connectez-vous ou inscrivez-vous pour continuer