PDA

View Full Version : Report paper size



phabio
2013-11-12, 08:36
With the actual report system, is possible to set the paper size and draw a report like an invoice?

thanks
Fabio

barrymavin
2013-11-12, 08:49
Hi Phabio,

Yes. You can createObect("webview") and write html into it formatted in any way you want. The webview is not displayed as it has no parent. If you want to preview the report just parent it into a form object. The print() method provides the ability to set the paper size and select the printer or generate as a pdf. This is (should be) all documented on the wiki.

phabio
2013-11-12, 09:05
ok,
thank you Barry.

yvonne.milne
2013-11-12, 09:12
Hi Fabio,

The arguments to webview.print() are listed in the Roadmap (http://www.lianja.com/resources/roadmap) (search for 'Beta9 R5'). We'll get them added to the Webview Class wiki page (http://www.lianja.com/doc/index.php/Webview).

Regards,

Yvonne

phabio
2013-11-12, 09:21
Ok,
I need to print report like this...
I think I'll wait for version 1.1 with the report designer ... ;)
479

yvonne.milne
2013-11-12, 09:59
Hi Fabio,

Probably not that tricky as an rsp page actually. Just work out the table layout in html then pull in the data. It would be worth you having a look at the report.rsp script in the Library - that is simpler than yours, but shows how to integrate NoSQL/SQL data commands and html.

Regards,

Yvonne

phabio
2013-11-13, 02:39
any example is very welcome .. ;)
now I'm very busy in my work on the main dynamics ax, but I can not wait to do more tests.

HankFay
2013-11-13, 17:40
Hi Phabio,

easy enough to design in Dreamweaver CS6 (did one a little simpler for a project), and paste into an .rsp.

In fact, designing something like this is likely going to have to be done in a good HTML editor. I believe I put a post up here somewhere on how I separate the html and data merging, to keep it manageable (and updatable: I read the changed HTML and push it back into the .rsp automagically).

Hank

phabio
2013-11-14, 03:42
Hi Hank, thank you for the suggestion.

DreamWeaver is free?
or I have to spend $ 3-400 to draw a report?
If I have to draw a report with variable sections, I create many HTML and paste them in the report program?

thank
Fabio

PS:
your ERD?

yvonne.milne
2013-11-14, 05:01
Hi Fabio,

The post Hank mentions is here (http://www.lianja.com/community/showthread.php?1161-Introduction-to-RSP-for-the-VFP-developer). In the same post, Barry also talks of using the <%@ include=... %> directive (to include code from another file - great if you have standard elements that you want to use in more than one report) and the <%=...%> directive to evaluate an expression and embed it directly in the html.

Putting my money where my mouth is :rolleyes: and starting designing in ckeditor in a webview (as per Hank's post) then adding in a bit of CSS (check out Hank's other great recommendation for an online CSS editor here (http://www.lianja.com/community/showthread.php?489-New-Shape-Widget)) and some NoSQL to grab the data and <%=...%> directives to include it in the html, I came up with the following:

480

Regards,

Yvonne

phabio
2013-11-14, 05:59
Wow, thankyou Yvonne.. I did not want you to waste your time ..
when I have a little time, I'll try to investigate thoroughly.
one last question, I can manage a graph report with "sections" that I can hide? for example, print the footer only at the last page and get the full page on the previous pages?

barrymavin
2013-11-14, 06:11
Don't underestimate what can be done in .rsp pages phabio. You can generate any style of report and save them as a pdf file which can be emailed using the built in sendmail() function.

You can equally do the same in JavaScript .jssp pages.

If you include the lib:/bootstrap/bootstrap.css file in your .rsp file you can spice up the report with nice fonts and other fancy styling, even add background watermarks to the pages of the report.

Bear in mind Yvonne did this to show you that it *can* be done in less than a day.

Lianja has a ton of functionality that is built in but it also lets you write your own custom tools that are automatically loaded when you startup the App Builder. These tools can be written in VFP, PHP, Python or JavaScript and have complete access to all the built in UI classes in Lianja. It is a relatively trivial task to write a "Report Wizard" (hosted as an extension in the "Tools" workspace) that generates a report based on report templates such as what Yvonne has just demonstrated to you.

Its just a matter of knowing what is there are how best to use it.

yvonne.milne
2013-11-14, 06:27
Hi Fabio,

Not a waste of time - I'm sure it will be a tutorial or an activity in a training course in the future ;)

Have a look at the Stackable Sections demonstrated in the example_tabletui App.

Regards,

Yvonne

phabio
2013-11-14, 06:31
I have no doubt about the potential .. but with VFP, with little effort could do several things on report .. with Lianja for my ignorance, no.
When there are examples of how to create reports like the one shown, where the page break is automatically according to the paper (now reports dgli come up with examples written in the middle between a sheet and another), with dynamic sections, whith picture, grid, etc etc...
481
I can create a report.

without examples, with report designer tool is simpler ... by code is more complicated ..

HankFay
2013-11-14, 13:06
Hi Yvonne,

will you design all my reports? Please? <s>

Hank

barrymavin
2013-11-17, 02:00
You asked for an example of an invoice which Yvonne took the time to provide for you, you them move on to another topic showing little interest in how it was done.

You know fine well that a Visual Report Designer is planned for v1.1 as stated on the roadmap. Repeating the same questions over and over will not cause v1.1 to get closer and closer, nor do i find it at all constructive. I would suggest that you go read the criteria that an MVP is chosen for. This is a developer community and I appreciate constructive suggestions which will improve Lianja, Criticism is all fine and well but focussing on features and functionality which is already documented on the roadmap serves no useful purpose.

if you want to expand your knowledge of HTML5/CSS take a look at this question on stack overflow which explains how to split long HTML tables across multiple printed pages.

http://stackoverflow.com/questions/1763639/how-to-deal-with-page-breaks-when-printing-a-large-html-table

phabio
2013-11-18, 02:24
Barry you're right, I apologize if sometimes exaggerate or jump from one topic to another.
In the management of data, I think I'm right, but I think many people, like me, do not have a lot of experience on how to make a report in this way .. I do not want to rush anyone saying "I wait for the graphical tool to make the report" .. simply, I will wait ..
I have no hurry ..

I really appreciate the effort that the whole team is making Lianja to complete the development VFP programmers who can carry this all to a new system of development.

and if I promised Lasagna for all those who pass by here .. it is precisely because I respect you all.
I do so many questions because I lost a lot of time looking development tools that give me satisfaction .. and I've lost a lot of Lianja ..
and my difficulty with English makes me more difficult to understand and explain things.
thank you all.

barrymavin
2013-11-18, 05:32
And I look forward to visiting Italy to try the lasagne. :)