Details
Yes, some details are missing. (Gasp, another list !!)
Create your own API to "front-end" a component
I suggest you do whatever you can to minimize any component-specific code which it might be convenient to put into your application code. As an example, there’s nothing in the DesignBais API for using the OWC that actually mentions the OWC - the OUTPUT.zz variables can be used with any server-side component. (Granted the attributes defined are specific to the features supported in the OWC but at least they called the variables OUTPUT.zz instead of OWC.zz.
In your own callable API you’d define some variables just like the OUTPUT.zz variables in DesignBais, but instead of setting the PROCESS.TYPE and PROCESS.REFRESH variables, you’d call to a program, something like:
CALL ZEDGRAPH( FILENAME, RESULT ) or
CALL JGRAPH( FILENAME, RESULT )
Rather than creating something completely new, you could just use the exact same DB variables but change their use to suit your purposes. Any developer using DesignBais in your environment would know that these are the only variables for graphing regardless of which component is used. As above, call to your API / Subroutine which would include the DBI.COMMON, so the OUTPUT.zz variables would be available to your code just like it is to the DB API for OWC. The only thing the routines need are a custom FILENAME, and some variable to pass back an error message or other return codes. The subroutines would handle the underlying operations of reformatting the DB variables for the specific component, generating the graph, getting it to the web server, and if all goes well they’ll just return with an OK message. If you do use the DB variables for your own purposes, it would be advisable to wipe them out after you generate your image.
This technique hides the underlying implementation from the BASIC application developer. Another article on Getting Client Info discusses a specific application which would do well to make use of this technique.
Relative merits of the OWC
OK, that’s how you would use alternate components to create graphs and charts. Why not just use OWC as documented with DesignBais? (Gratuitous and unncessary list follows
)
You might want to use OWC in a client mode (outside of the supported DB context) to provide more interactivity. This should be possible using the info I provided for Client-side scripting in DesignBais. But, since OWC is an ActiveX control (as are many of the other client-side alternatives), it can only be used with Internet Explorer. If you want an interactive graph in W3C mode you’ll need to use something else. Remember, I’m not saying we can’t use OWC in W3C mode through DB, because DB renders pure images and does not put anything else into the client.
There are many resources available if you want to use the OWC yourself for client or server-side development, in particular on this MSDN page for Office development, click on the link for "Office Web Components". If you choose to use the OWC outside of the standard DB context, be aware that there are licensing rules which must be observed, especially if deploying the OWC to client browsers.
On the other hand one reason to not use OWC is that Microsoft will eventually stop supporting it, but for our purposes we will still be able to use it for many years to come.
More than just a tool for DesignBais
Once you start using graph components for DesignBais, someone is probably going to ask if you can use them for your non-DB printed reports, send them in emails, etc. The answer is an emphatic yes. Once a graph is generated into an image file it can be incorporated into any document that renders images: HTML webpages or email, word documents, even PDFs. If you use the OWC or other components to generate charts for your DesignBais web forms, there’s no reason not to use that exact same code to generate graphs in other parts of your application.
And finally, to pre-empt the next question that might come up "can we put this data into Excel?" : Sure you can. You can even use Excel to generate your charts and graphs. In fact I wrote a product several years ago that generated real Excel documents from BASIC, including charts and graphs, just like we’ve seen here in this article. NebulAnalysis is no longer offered as a product but we can talk about doing these sorts of things in your application. Let me know if you’d like to see an audio/video presentation of how it worked.
Have fun ! And please let me know if you use the information provided here to come up with something neat !
In an upcoming article I’ll discuss the benefits of using constants in DesignBais. Tables will include constant names for graph types (did you know there are really over 60 graph types and not just those documented in the DesignBais reference manual?), and dialogs (types, buttons, return values). I’ll also touch on how Equates should and shouldn’t be used from the Field Properties form and in code.
4 Responses
phil short
23|Aug|2006 1Interesting!
I’m looking forward to seeing how I can use third party tools with DesignBais. I have previously wriiten .net apps using such tools – Dundas Charts and Telerik Controls – to provide graphically rich business information systems. I started out with OWC, but quickly move on from that because of the need for interactivity. There is also the requirement to have OWC installed on the server, and an Office licence to be consumed. Not normally an issue, but I’d guess the take-up of products like OpenOffice might be slightly higher than the norm in the, er, "financially astute" multivalue community.
I’m hoping the experience with DesignBais isn’t going to be much more difficult than dropping a third party control onto a form in VS and setting a few properties in the aspx code behind page to hook the control up to an mv.net generated dataset. If its messy to do that ,and your app has a lot of charts rather than transactional data ,then you probably wouldn’t be using DesignBais. Horses for courses.
Tony Gravagno
23|Aug|2006 2Phil, thanks for taking the time to comment. I understand everything you’re saying. I’ll write a small follow-up to this article soon regarding OWC licensing and possible errors which might compel someone to consider the alternatives discussed here.
Running in an IFrame to an ASP.NET component can give us that interactive experience, but the DB form won’t be interactive with that chart without some diligent effort. It’s cool to have the chart right within the page, but it might be more elegant from a coding perspective to just launch a separate ASPX page, let the user do what they need interactively, save some state on the server via mv.NET or otherwise, and then have DB read that state back in a modal return event when the user closes their popup form.
DesignBais is sort of intended to be a complete solution for people who don’t want the bells and whistles available in ASP.NET – or the related hassles. I think my ongoing message here is that there are those of us who appreciate DesignBais for what it is but we still want some of those extras – and I’m trying to show people how to get the best of both worlds. This turns the "either / or" and "horses for courses" position into a "best tools for the job" position, where DesignBais fits right in with whatever else we need to create the environment we want.
phil short
24|Aug|2006 3Tony
I think we’re singing from the same hymn sheet here. I’m not that far down the road of working out what I can and can’t do with DesignBais (but I am intending to learn fast!), but I’ve been around long enough to know that there is ALWAYS a trade off between functionality and ease of use/speed of development, and also that these days developments (and web developments in particular) call for a mix of technologies. You can’t be too precious about any particular tool, you just have to be aware of the tools available and pick the best one for the job at hand. Now if one "swiss army knife" tool can get 80% of the job done, great.
I see a parallel with the situation a couple of decades ago with Reality, where A*L*L was available as a 4GL. It was great at what it was good at, and you could rattle out apps if you knew how to use it, but for some things you just had to go back to DataBasic to get the job done. I’m hoping DesignBais will fill a similar role now, supplemented by mv.net/aspx/vb.net/Javascript etc for the complex, awkward or just plain flashy stuff.
I’m starting to see what you mean by the comments made about getting excited about programming again.
Tony Gravagno
17|Sep|2010 4People interested in this charting for DesignBais blog may also be interested in some new work that I’ve been doing:
http://nebula-rnd.com/blog/tech/mv/2010/09/mvcharts1.html
(So far there are Parts 1 and 2 of that “series”)
Leave a reply
You must be logged in to post a comment.
Search
Tony on Twitter...
Awesome! Gotta get me one tomorrow! http://t.co/xbpGrGNF INTRODUCING THE WORLD'S FIRST HOME MINI-NUCLEAR GENERATOR from @TigerDirect 2 months ago
Improve your OO coding with refactoring. Just take an hour or so to click through these tips: http://t.co/AghAGEbT 2 months ago
Fascinating blog/discussion on (C#) Enumeration classes to replace Enums, and related pros/cons: http://t.co/O2F5vh3M 2 months ago
@dwolt on snupnow: 1) create effective About page: what is it? 2) (advice given to me) get paying clients first, investors follow. 2 months ago
Archives by Tag
.NET AccuTerm AnzioWin API array avatar BASIC blog BlueFinity Caché CDP charts community correlative D3 dictionary distributed processing e-mail environment Excel Facebook file structure forum FOSS frames Google GPS graphs gravatar GUI images import/export item-id Java jBASE keys lists marketing memory mobile multivalues mv.NET mvBase MVSP mySQL NebulaXChange NebulaXLite NebulaXPlus OpenInsight OpenOffice Open Source Oracle PBX POS Postgres QM QMClient RDBMS relational SaaS SAPI savelist scanners select shell shutdown signature SMS SOA spam Spectrum speech SQL Server TAPI telephony tutorial Twilio U2 U2.NET UniObjects video Visual Studio voice Web Services wordpressCategories
Blogs
Forums
Sites
This Blog