Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bazaar » Very Simple Report Generator (Use QTF format)
Very Simple Report Generator (Use QTF format) [message #24050] Tue, 22 December 2009 23:14 Go to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

I make my 3 cents in the common fund decisions.

For my needs, I made a simple report editor which allows users to easily edit the reporting forms.

Allows:
- Substitute the arbitrary variables and functions (defined at the stage of application programming);
- Generate reports on the database (well, or for any tabular data);
- Insert images, and graphics functions (including data from the database);

The end user is editing a report in a file qtf-template in a program such as UWord or directly in the program (qtf-template can be stored in a separate database table).

The idea is to standard qtf-file to use as a template simply by replacing the variables they refer to the real data.

Variables in the template are of the form ##VARIABLE - Report generator simply finds them in the template and replace.

Method of substitution is programmed using the Callback-functions.

That package.
  • Attachment: RepGen.7z
    (Size: 1.98KB, Downloaded 359 times)


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24051 is a reply to message #24050] Tue, 22 December 2009 23:16 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

This Package testing RepGen.

Must be in the MyApps/RepGenTest.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24052 is a reply to message #24051] Tue, 22 December 2009 23:22 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

Also, spread one of the examples in which the print function converted to RepGen.

It is necessary to put in a folder MyApps/AddressBookXML2_RepGen.
To choose the form of a report, you need to choose the menu command Select Report Template qtf one of the files in a subfolder of reports. and then print.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24053 is a reply to message #24052] Tue, 22 December 2009 23:24 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

In the archive versions of finished reports that prepares RepGen.

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24054 is a reply to message #24053] Tue, 22 December 2009 23:27 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

PS.
Can someone prepares reports easier and more convenient way. Please share your experiences.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24057 is a reply to message #24054] Wed, 23 December 2009 10:25 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3003
Registered: August 2008
Ultimate Member
Hello Sergey

Why do not you put it in Bazaar ? Smile

Best regards
Koldo


Best regards
Iñaki
Re: Very Simple Report Generator (Use QTF format) [message #24059 is a reply to message #24057] Wed, 23 December 2009 18:29 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hello sergey,

I was actually trying to figure out how to do the same thing, so you're package comes at the wright time Cool

I will take a look at it, and since I'm on vacation, I'll have some time for time for it.



Re: Very Simple Report Generator (Use QTF format) [message #24062 is a reply to message #24059] Wed, 23 December 2009 19:48 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

About placement in Bazaar - I do not know how to do it.

Maybe we need to write in this branch fixed topic on HOW TO PLACE PROJECTS IN BAZAAR?

I propose to join, and improve this generator. I think it will be useful to many, especially beginners.

I think that we'll get the conversion control is not using CallBacks, but by calling the virtual member functions. This is the first I saw.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24063 is a reply to message #24059] Wed, 23 December 2009 20:22 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hello again Sergey,

Looks pretty good for a start, and I think it can easily be generalized to a more complexe loop mecanismes:

All we need is a depth counter that keeps track of:

  • depth
  • context zone ( dependant of depth )

==> example: [depth, [0, 0, ... ]]


##BP                [0,[0]]
  ##VAR1            .
  ##VAR2            .
  
  ##BP                [1,[0,0]]
    ##VAR31           .
    ##VAR32           .
  ##EP              .

  ##BP                [1,[0,1]]
    ##VAR41           .
    ##VAR42           .
  ##EP              .
  
  ##BP                [1,[0,2]]
    ##VAR51           .
    ##VAR52           .
  ##EP              .
  
  ##VAR5            .
##EP              .

##BP                [0,[1]]
  ##VAR6            .
  
  ##BP                [1,[1,0]]
    ##VAR31           .
    ##VAR32           .
  ##EP              .
##EP              .



The following callbacks could then be called with the depth/contex info as parameters
- RepGenCalculateStart
- RepGenCalculateBody
- RepGenCalculateFinish

The only other part would need modification is the "body string grabber" which needs to take in account the loop/context imbrication.


I think I'm gonna give it a shot Rolling Eyes

If you don't have a better Idea of course Wink
Re: Very Simple Report Generator (Use QTF format) [message #24067 is a reply to message #24063] Thu, 24 December 2009 01:35 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

I do not quite understand the question. Try to speak in other words.

As I understand it - you need Group Header / Group footer, or even SubGroupHeader and SubGroupFooter.

If so, then I'm going to raise the functional RepGen to functional GroupFooter / GroupHeader (with Totals / SubTotals), the more that make up this left quite a bit.

With all the improvements I want to interface would remain extremely simple.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24068 is a reply to message #24052] Thu, 24 December 2009 09:13 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

sergeynikitin wrote on Wed, 23 December 2009 00:22

Also, spread one of the examples in which the print function converted to RepGen.

It is necessary to put in a folder MyApps/AddressBookXML2_RepGen.
To choose the form of a report, you need to choose the menu command Select Report Template qtf one of the files in a subfolder of reports. and then print.


Nice work Sergey!

But how about to make this report templates visual editable?

Now I do report in Oracle BI Publisher for my company. It is very interesting because extract mechanism (DataTemplate) and visual template (LayoutTemplate) is separated.

The mechanism is follow:
- DataTemplate is a xml file with simplisted rules and sql selects.
- LayoutTemplate can be .rtf, .xls, .pdf, .xsl o .fo file format. I do Layout templates in .rtf and edit it easy in Microsoft word or OpenOffice writer.

Another interesting mechanism is Data Composition System in 1C (http://v8.1c.ru/overview/Term_000000093.htm#1)

Both variant I was tested. 1C mechanism is more interesting, because exists possibility to change data sets (add.remove columns, set filter, make layout template more flexible : http://v8.1c.ru/overview/Term_000000616.htm#1).

Regards, Ion (tojocky)
Re: Very Simple Report Generator (Use QTF format) [message #24073 is a reply to message #24068] Thu, 24 December 2009 13:25 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hi Tojocky,

Sergey's mecanism is already visually editable since the template is a QTF file. Of course it can only be edited with UWord but for a start that's a great start.

The main point that frighten's me a little bit is the fact to have direct QTF code parsing : I hope the QTF syntax is very stable Confused

Anyway this system is
- very lightweigth
- depends on nothing else except U++
- is easy to use

A more complete version of report generator is welcome but since this one has no dependencies I think it's worth enhancing a little bit.

Re: Very Simple Report Generator (Use QTF format) [message #24074 is a reply to message #24067] Thu, 24 December 2009 15:01 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hi Sergey,

Quote:

Group Header / Group footer, or even SubGroupHeader and SubGroupFooter


Is exactly what i mean but I think everything is already here to do it ... except a context management.


Since a good example is better than explanations, I modified you're code to add context management but I'm stuck with the regexp ( that is hieroglyphs for me ). And I'm not sure it will do exactly what I wan't.

NB: I think we can do better than just adding GroupHeader/GroupFooter, since with context management we have complete information on "where the generator is".
Re: Very Simple Report Generator (Use QTF format) [message #24076 is a reply to message #24062] Thu, 24 December 2009 17:18 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

sergeynikitin wrote on Wed, 23 December 2009 20:48

About placement in Bazaar - I do not know how to do it.

Maybe we need to write in this branch fixed topic on HOW TO PLACE PROJECTS IN BAZAAR?

I propose to join, and improve this generator. I think it will be useful to many, especially beginners.

I think that we'll get the conversion control is not using CallBacks, but by calling the virtual member functions. This is the first I saw.


Do you have access(username and password) to edit bazaar svn from google?
Re: Very Simple Report Generator (Use QTF format) [message #24077 is a reply to message #24076] Thu, 24 December 2009 19:14 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

Reply to Tojocky:
As rightly said Didier this generator for a completely simple forms in which logic and business logic MUST hardcoded by author.

In addition, the method of editing is targeted specifically to users who are not at odds with the computer, but they managed to learn one of the office suites. For a more comprehensive report in fact need to apply more powerful tools.

About placement in Bazaar - I do not know how to do it:
I havn't password to google svn.

The answer to Didier:
With regexp in fact a problem. I discovered this when understood in pcre-regexp. The fact that the implementation, application of U++ is not quite standard - so not all described in the documentation work.

I have not watched your example. I'll see tonight. .

I do not understand wishes about the context. If you can repeat in other words about the context idea.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24080 is a reply to message #24077] Thu, 24 December 2009 21:00 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor


Hi Didier!

I looked at your addition to repgen.

I did not understand the purpose for which the right context and zone. (By the way calls ##BP and ##BT can not be nested)

If you somehow have to enumerate, it is easiest to do in client callbacks.



SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24095 is a reply to message #24080] Sat, 26 December 2009 20:25 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hy Sergey,

Merry Christmas Smile

The context information is to allow nesting ( or at least text nested in text and tables nested in text as) and different parts that follow each other ( Exactly the way the resume follows the information in you're example ).

I added an example to show what I mean.

The context information is intended to be used by user code to know in which section it currently is. This may seem a bit complicated but it allows infinite nesting / sectioning although the user code becomes more and more complicated.

Re: Very Simple Report Generator (Use QTF format) [message #24106 is a reply to message #24095] Sun, 27 December 2009 00:26 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

It's just a different terminology?

I feel no need to create additional entities.

This problem is perfectly solved by the presence of Group Header / Group Footer.

I'm trying to do 2 things:
- Group header / footer,
- Variable number of columns.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #24138 is a reply to message #24106] Mon, 28 December 2009 12:18 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 488
Registered: November 2008
Location: France
Senior Member
Hi Sergey,

I'm also working on nesting/(GroupHeader/GroupFooter).

If I come up with a working code quickly, maybe will be able to compare our solutions ?)

Re: Very Simple Report Generator (Use QTF format) [message #24140 is a reply to message #24138] Mon, 28 December 2009 15:17 Go to previous messageGo to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 736
Registered: January 2008
Location: Moscow, Russia
Contributor

Yes, of course. I will try not to delay.

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Previous Topic: BarCode128: string to image (Candidate for upload to Bazaar)
Next Topic: Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz)
Goto Forum:
  


Current Time: Mon Oct 14 15:48:20 CEST 2019

Total time taken to generate the page: 0.02800 seconds