BIRT dynamic image url - cannot get access to data columns - javascript

I am trying to display different images based on data returned. I am running into the following issues
DataSet is not available on the image control for me to make decisions based on the column information. I am using a grid layout (no tables)... Think of a letter
I tried to create report level variables and assign it the value from dataset during the onFetch event. However, that assignment does not happen.
I have tried both
rptvar = dataSetRow["colname"]
rptvar = Row["colname"]
I have confirmed that onFetch event does get called using Javascript debugging (see http://www.lebirtexpert.com/wordpress/2010/08/)
Please let me know how to access dataset columns to dynamically create the image URI

There's a post on the BIRT world blog that should be very useful to you:
http://birtworld.blogspot.com/2010/09/birt-image-report-item.html
Kudos to Mr. Weathersby!

Related

Alpha anywhere: How to get all the data from the list so that I can access them using Javascript

Using alpha anywhere. I have a list, say 'roles' and 'companies' filtered by user_code. I am using it offline so I need everything to be pre-populated while connection available. When Offline, I need to filter the list by company so that I can get the 'roles' based on the current company_session. Can anybody point me to the right way? Or at least can anyone teach me how to get the data from the A5W list and bring them to javascript accessible like javascript array, or JSON format?
I figured it out. too long on a computer. Alpha Anywhere actually have simplified this. In UX component method I found getListData method. It done exactly what I need!! at least I am one step ahead.
var data = {dialog.Object}.getListData('USERROLESLIST');
var dataJSON = JSON.stringify(data);
Then, the JSON.stringify give me the visual of the actual data in the list.

Alfresco custom UI controls - Associations

I'm trying to build a custom UI control in alfresco to display the associations of an object type that I have.
Basically I have two object types; Code, which is a key value pair, and CodeScheme which contains multiple child associations to codes, it's essentially a mirror of a map structure I have in a different system.
The problem I have is that the codes are automatically generated, so they get the UID names, whereas really I'd like to present them as 'key=value', 'key=value', etc (ideally I'd like to present it as a table).
I've already created a custom control and added it to share-config-custom, and confirmed that the configuration is working correctly. What I'm not really clear on now is:
a) How to attach a javascript to the control so that I can process the association data.
b) How to get hold of the codes in javascript, and read their properties.
I'm just looking for a push in the right direction.
Thanks :)
One idea would be to use a form filter. Your form filter could iterate over the child references, fetch each child node, grab the data you want to display and then add one or more new properties with that data.
Then, your form control is hooked to the fields your form filter dynamically added to the form data. It can then read and display the data as needed.
Without a form filter I think you'd have to use JavaScript to parse the child association refs and use AJAX calls to fetch each child's node data, then format that as needed. The form filter idea would be less traffic from the browser.

CRM2011 check if notes on custom form contains data via JavaScript

Hi peeps on stackoverflow,
Product: CRM2011, should be latest roll-up
I'm currently trying to get the following to Work:
- A custom CRM form has been made. This form contain the 'Notes' tab. I would like to dynamically 'expand' this IF and only IF the 'Notes' tab contains notes data. I'm trying to do this through JavaScript loaded into 'Form Libraries'. I can easily 'expand' the notes field but I'm having serious trouble determining if the 'Notes' tab contains notes data.
I can understand that accessing the 'notes' data through the DOM is not a good idea so I've tried through XRM. Looked through https://msdn.microsoft.com/en-us/library/gg334351(v=crm.5).aspx to see my options. But I can't seem to get to one where I can access 'notes' and base the expansion of the notes field on if there is data or not in 'notes'.
Is this possible? I'm looking forward to hear from you and thank you very much.
Notes are their own entity type, entity logical name is Annotation, that is why you won't find the notes data within Xrm.Page. I'm making some assumptions here, but if you've set up this custom entity to follow standard conventions, any notes on that record will be separate Annotation records with a reference to the custom entity record. using the sdk.jquery.js script provided with the SDK you can do a query on Annotation records that reference the record you are currently on. That would be a supported way to determine if the record has notes. Using the OrganizationData.svc endpoint you would have an OData query that looks something like this
AnnotationSet?$filter=ObjectId/Id eq guid'34d19133-c0ec-e311-b39c-6c3be5bd2b14'
The guid value there would be the guid of the record you are currently on, which if you haven't already acquired within your script, you can get it pretty easily with something like this
window.parent.Xrm.Page.data.entity.getId().substring(1, 37)
or without the window.parent prefixing it

Dynamically updating VivaGraph JS

I'm using VivaGraph to create a graph on my webpage as per some data. I used a websocket connection to receive the data(its an infinite data stream). I want to update my graph based on the data received but I'm not able to figure out how.
For example:
Suppose my graph currently that I can see on the screen is A----B
The next date received says that now there's a node C that's linked to B and the link from A to B has been deleted.
How do I do this on the same graph efficiently? That is: Now, I can see B----C
Thanks
The graph can be updated in real time after rendering without any problems or using graph.beginUpdate() and graph.endUpdate().
The problem and the errors seem to lie only in cases where an exception is risen, such as adding a node that already exists or removing a link that doesn't. Make sure that there are no exceptions using normal if conditions and the graph will work perfectly in real time.

BIRT: How can I access the current DB connections/session from JavaScript?

I need to run a piece of Java code which builds a complex SQL query. I know how to call the Java methods from JavaScript in BIRT but how can I get a pointer to the current DB session/connection?
If you modify the onCreate event of your Data Set, you can do this on the report and leave BIRT to control the DB connection. Do the following:
Select your Data Set on the Data Explorer window
Select the scripts tab along the lower edge of the canvas area of Eclipse
Select the "onCreate" event from the drop-down list of available events along the top
Work your query-building magic in the editor, using JavScript. You can import your existing POJO that build your query out using the "Packages" construct.
Once your POJO has built the query, return it to the script and set "this.queryText" equal to the resulting string.
This will ensure the data set executes the new query, not the one used to create the data set.
The only gotcha to watch out for is that the query you set in the script must return the same number of columns and have each column be named the same as in the default configuration and share the same data type. How the individual colums get populated is up to the SQL, how the resulting data set looks must me uniform.
Good Luck!

Categories