Forum Replies Created
-
AuthorPosts
-
amckinlay
KeymasterSorry, I was giving you the wrong directions.
You do NOT need the plugin.
CustomReportsMenu is wrong. Change GetSource to be:
GetSource(source) { return Object(query: source, name: source) }You also need to run (from the WorkSpace):
Params.Ensure()I tested with a fresh download and this seems to work for me. (I could recreate your problem.)
If you look at the Accounting download you can see that it redefines parts of Reporter so that you choose a data source instead of just entering a query. That is what I was thinking of.
amckinlay
KeymasterLooking at CustomReportsMenu.GetSource it appears that it is not finding your data source.
I can not tell from your screen shot if it is asking for the correct name? (the one you defined) Double click on ‘x’ in the debugger and see if Source is ‘Liste’
Did you restart Suneido to ensure the plugins are updated?
Did you name your plugin “Plugin_Reporter”? (It must be exactly this name.)
amckinlay
KeymasterHi Pierre,
After editing plugins, you may need to restart Suneido.
When do you get the error? Do you get the debugger? If so, what does it show?
amckinlay
KeymasterHi,
You probably need to define the data sources for your reports. Create a library record called Plugin_Reporter with something like:
#( ExtensionPoints: ( (queries) ) Contributions: ( (Reporter, queries, name: 'Tables', query: 'tables') ) )You can define multiple contributions. These are what will show up in the Data Source pull down list in Reporter.
If you download the Accounting Application it has lots of examples.
amckinlay
KeymasterI’m not sure why Wcstombs() is causing problems (I got an access violation when I tried your example). I assume it’s because the input is “bad”.
Your example is backwards – Suneido uses 8 bit character strings, so “Test” is (more or less) UTF-8 (= multi byte string = mbs).
s = “Test”.Mbstowcs()
=> “T\x00e\x00s\x00t\x00\x00\x00”s.Wcstombs()
=> “Test”amckinlay
KeymasterThis works for me:
Dialog(0, #(Mshtml 'hello world' xmin: 500, ymin: 500))amckinlay
KeymasterIt is not that hard to figure this kind of thing out yourself. (I have to do the same.)
I looked at BrowseControl and I see List_HeaderContextMenu. If I comment this out, then there is no context menu on the header.
amckinlay
Keymaster[…] is equivalent to Record(…) in code, or to #{…} in a constant
I use it because it is shorter
Although you have to be careful because Record is slightly different from Object1) You can sort your data before you add it to the list view. e.g. data.Sort!(By(#name))
Or if you use DragDropListViewControl (see below) you can call the SortList method.2) If you use DragDropListViewControl instead of ListViewControl then you can click on the header to sort. (And you can also rearrange the columns.)
amckinlay
KeymasterI will correct the help, thanks.
Here is an example that works for me:
Window(Controller { New() { .list = .FindControl('List') .list.SetColumns(#(name, age)) } Controls() { return ['Vert', ['ListView', style: LVS.REPORT], #(Button Add)] } On_Add() { .list.Addrow(#(name: Bob, age: 24)) .list.Addrow(#(name: Sue, age: 19)) } })amckinlay
KeymasterThe problem is that clicking on a row only selects the row if you click on the first item. (And ItemClicked is passing the selected row.) This is Windows, not Suneido.
One way to make it work is to set a style with something like:
.List.SetExtendedStyle(LVS_EX.FULLROWSELECT)
amckinlay
Keymaster1) There is a Windows message to set the tooltip timing – TTM_SETDELAYTIME. This would let you keep the tooltip open longer. For example, at the end of ToolTipControl New you could add:
.SendMessage(TTM.SETDELAYTIME, TTDT.AUTOPOP, 30000) // 30 sec
Note: I have not tested this.
2) I am not sure what you mean by “false is returned”. Do you mean the value passed to ItemClicked? This value is the row currently selected. If no row is selected it will be false.
According to the MSDN documentation for list view NM_CLICK you must use LVM_SUBITEMHITTEST (ListViewControl SubItemHitTest) to determine which item was clicked on.
February 14, 2015 at 8:29 am in reply to: counting based on more than two members of an object from inside a loop #1152amckinlay
KeymasterYou could build the code the same way you would build the query where and then use string.Eval. You would need to write it as a function and pass in the arguments. But that should not be necessary.
If you make a list of the field names then you can just loop through them.
function (row, fields) { for f in fields if row[f] isnt true return false return true }The first time the list would just have one field, the second time two fields, etc.
Is that more what you are looking for?
February 13, 2015 at 7:39 am in reply to: counting based on more than two members of an object from inside a loop #1150amckinlay
KeymasterI am not sure exactly what you are looking for.
Your lines of code look valid (except you have extra opening parenthesis)
You could use the “functional” methods like object.Filter and object.Count or the combined object.CountIf
e.g. n = rows.CountIf({ it[test1] is true and it[test2] is true })
There is no shortcut to output a list of objects to a database table. It would be easy to write something that used a loop. If you have the data in memory it will be faster to process it there.
I hope that helps.
amckinlay
KeymasterThe new Community Edition works fine as well.
amckinlay
KeymasterHi Tahar,
With the new database engine in jSuneido (the Java implementation) it would be reasonable to implement replication.
Because the database file is append only, the replication process would only have to append the same data to the replica.
However, this has not been implemented yet, and it would probably be more complex than this appears.
-
AuthorPosts