Monday, February 04, 2008

View -> JSON -> Excel report

Usually I (probably as all) used agent approach in web applications for making excel's reports. In my case I was asked to make some reports exporting all data from current view (reports should look like in view).

So I decided to use another approach (in my case it was JSON because I like it more). Here you could download the demo version how to receive data from LN database.
to receive all documents from view I used:
?ReadViewEntries&count=1000&Start=1&outputformat=json&ExpandView
to receive the name/title of columns I used:
?ReadDesign&Outputformat=json

and in the end of the story I used next code to create excel report

function
appExcel(){
if (
window.ActiveXObject){
var
xlApp = new ActiveXObject("Excel.Application");
xlBook = xlApp.Workbooks.Add();

xlBook.worksheets("Sheet1").activate;
var
XlSheet = xlBook.activeSheet;

XlSheet.cells(1,1).value = "value";
xlApp.visible = true;
}
}


This function works only in IE as far as I know.

Thursday, January 31, 2008

OutputFormat=JSON

Just found,

I read that it should be only in 8.0 version, but it works in 7.02 also, but it is undocumented feature of Notes Domino. I pulled &OutputFormat=JSON as additional parametres in URL and got back JSON. Great, it opens some new ways for me. Will play with it a little more, and probably will get something to show very soon.

Wednesday, January 30, 2008

All LotusSphere2008 presentations here (free and without any passwords)

I found (Actually not me but in any case I will share them as well) ! One of my blog's friend found the way how we can download all presentations from LS2008: download

Probably it will save a lot of time for many people which looking for them in Internet.

But I don't know, is it legal to share them? because if no, I will remove the link.

Monday, January 28, 2008

Generate HTML for all fields


I used it for some years and only now I read some articles about several bugs which didn't see before. Probably because I've made not so difficult applications in web, but in any case I still like it.
It makes my life more simple!

several Domino->JS functions: StrLeft, StrRight, StrLeftBack, StrRightBack, StrMidleBack, StrMiddle

Here are a few JavaScript functions to mimic the @-function capabilities. I dont like to write every time my own functionals, just because they will be my and I will be proud for them. I don't like this :). I prefer to find some different solutions and take one that better (of course on my opinion)

function rightString(fullString, subString) {
if (fullString.indexOf(subString) == -1) {
return "";
}
else {
return (fullString.substring(fullString.indexOf(subString)+subString.length, fullString.length));
}
}

function leftString(fullString, subString) {
if (fullString.indexOf(subString) == -1) {
return "";
} else {
return (fullString.substring(0, fullString.indexOf(subString)));
}
}

You can find many other functions here site