Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Reporting with EWB
Wed, Sep 16 2015 8:08 PMPermanent Link

Richard Harding

Wise Nutrition Coaching

Hi,

I have bought EWB after using DBISAM and ElevateDB for years.  I manage to install EWB and run the samples and have produced a simple DB application.  

There have been several posts regarding producing reports with EWB but am really not much wiser about how to proceed.

Can someone give me some guidance on how to produce reports from ElevateDB databases in this environment?

Many thanks.

Richard Harding
Thu, Sep 17 2015 1:34 AMPermanent Link

Eivind

Hi Richard

I'm using plenty of HTML and PDF reports with EWB and I don't create them with EWB. All is done server side for me. My back-end is a MySql database and the json is served by ISAPI dll's written in Delphi. I'm using the EWB delphi components to handle all the dirty work for me. Super simple indeed.

As for reports, I use the Fastreport components that ships with Delphi. All EWB doe's is fire a server request with some parameters to the server. The server then creates the PDF or HTML reports and ships it back to EWB for either display or download. If the users browser have a PDF plugin, then it will nicely be shown in the plugin. You could also implement several of the Javascript / HTML5 PDF plugins that will make sure your users always see the report in a plugin. However, I ended up not using them due to all the problems getting it right with all browser on the market today. As for HTML reports, just display them in a TBrowser component. I have found that reports with very complex design and layout does not work very well with HTML. However, if your reports are simple and tabular lay out, then HTML reports from Fastreports work very well. I know that Fastreport also have a native format as well. Not sure if there is a web plugin for display such reports.

Eivind
Thu, Sep 17 2015 5:55 AMPermanent Link

Matthew Jones

Eivind wrote:

> I'm using plenty of HTML and PDF reports with EWB and I don't create
> them with EWB. All is done server side for me.

I do similar - I generate the PDF reports using a template from
WPTools, all server side. But, the HTML option could work well for
simple reporting, you can just build it all up in a string and assign
it as the content of a viewer. I've not tried printing the actual EWB
pages, but a quick test shows that you could do that too. My web shop
displays the details of an order as panels of varying size and content
according to the product etc, so it wouldn't be hard to make a page for
a report.

I guess the key is that you can do what you want really, but fancy
stuff may need server support.

--

Matthew Jones
Thu, Sep 17 2015 8:11 PMPermanent Link

Richard Harding

Wise Nutrition Coaching

Thank you Eivind and Mathew

For your assistance - it is really appreciated.

From what I gather, it appears that I still need a Delphi reporting application (using FastReports, WPTools, ReportBuilder or something else) on the server, to produce a HTML or PDF report.

I did see a reference somewhere to a demonstration of building a WebServer application but I cannot find it.  Can someone assist?

This is all a new environment for me so there is much to learn.

Thank you . . .

Richard Harding
Fri, Sep 18 2015 1:29 AMPermanent Link

Eivind

Richard

Not sure what kind of back-end you plan to use, but if you plan to use Delphi it's not really hard to build something quite fast. I chose to use IIS and ISAPI modules through a web broker project. This way you just hook TEWBDatasetAdapters up to your query's and they take care of all the JSON encoding for you. For committing data you use a TEWBDatabaseAdapter to do the work for you. The reason I choose IIS is that my clients required me to use SSL certificates that were already plugged into their IIS server. At the time when my project started, the EWB Web server did not support SSL certificates. (Now it might have support for SSL, I'm not sure. Someone higher up the Elevate food chain can tell you).

The other solution is to use the EWB Web server and write dll's with delphi to plug into the EWB Web server. In Delphi after having installed the EWB module components, just click on the new Elevate Web Builder Module project and it set's it all up for you. Examples can be found in C:\Program Files (x86)\Elevate Web Builder 2\examples\datasetmodule. Based on these project, I learned to create my own ISAPI dll's for IIS.

Enjoy!

Eivind
Fri, Sep 18 2015 9:58 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< Can someone give me some guidance on how to produce reports from ElevateDB databases in this environment? >>

The simplest option is to use FastReport in an EWB web server module to produce HTML/PDF using the report export functionality, and return it as a response.  You can see how this is done with the PDF Client/PDF Module examples that ship with EWB.  The client is an EWB client application, whereas the module is an EWB web server module project (Delphi).  The only difference when using FastReport is that you will use TEWBServerRequest.SendCustomContentStream method with the FastReport export stream (TMemoryStream) instead of the TFileStream instance that the example uses:

frxPDFExport1.Stream:=MyMemoryStream; // You'll need to create the MyMemoryStream instance beforehand
frxReport1.Export (frxPDFExport1);
Request.SendCustomContentStream(MyMemoryStream,'application/pdf','');

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Sep 18 2015 5:53 PMPermanent Link

Richard Harding

Wise Nutrition Coaching

Thank you Eivind and Tim.

I will check out the examples.

Richard Harding
Image