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++ » UppHub » Very Simple Report Generator (Use QTF format)
Re: Very Simple Report Generator (Use QTF format) [message #37082 is a reply to message #37081] Mon, 20 August 2012 16:10 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

All right.
Substitution of global vars may be made in Report Start OR ReportFinish (in simple reports).


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37083 is a reply to message #24050] Mon, 20 August 2012 17:50 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
I don't understand how it works...

RepGenCalculateBodyBeforeSubst() and RepGenCalculateBodyAfterSubst() seem to never been called, neither in Repgen.cpp nor in AdressBook.cpp...

PCRE_Replace(String& where, String s_from,String s_to) doesn't works, because where is null...

(Just trying with the files in bazaar without any change).

???

When (or how) RepGenCalculateBodyBeforeSubst() and RepGenCalculateBodyAfterSubst() are supposed to be called ?
Re: Very Simple Report Generator (Use QTF format) [message #37087 is a reply to message #24050] Tue, 21 August 2012 10:17 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Please, could other people confirm if it's working or not ?

To be sure, I tried with a very new intall of upp 5283, and I have the same problem.

I can obtain the printing of the first row of data when :
- I add the missing callback to RepGenReportStart in AdressBook.cpp (initiating iterator to 0),
- I add a call to RepGenCalculateBodyBeforeSubst() and RepGenCalculateBodyAfterSubst() in Report.cpp before and after the call to RepGenCalculateBody().

I'm very surprised that I cannot get it working "out of the box", unless nobody uses this and saw the problem...

I was using an old version of RepGen, it was working well and very nice to have good reports easy to modify. The new version adds usefull features, but is it really working ?
Re: Very Simple Report Generator (Use QTF format) [message #37089 is a reply to message #37087] Tue, 21 August 2012 15:02 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Ohh... I'll test in last SVN-version.
Maybe...

I'll test tonight.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37091 is a reply to message #37089] Tue, 21 August 2012 19:31 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Test done.
Diagnostic:
Test examples is for old RepGen.
Test examples is NOT work with current RepGen.

Last RepGen is here.
  • Attachment: RepGen.tar.gz
    (Size: 114.06KB, Downloaded 372 times)


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37092 is a reply to message #37091] Tue, 21 August 2012 19:39 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Worked TestAxample 1:
Put to:
/upp/bazaar/RepGenTest/main.cpp
  • Attachment: main.cpp
    (Size: 3.17KB, Downloaded 371 times)


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Tue, 21 August 2012 19:40]

Report message to a moderator

Re: Very Simple Report Generator (Use QTF format) [message #37093 is a reply to message #37092] Tue, 21 August 2012 20:41 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Last RepGen is here.
  • Attachment: RepGen.tar.gz
    (Size: 59.52KB, Downloaded 377 times)


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37094 is a reply to message #37093] Tue, 21 August 2012 20:47 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

RepGen is not very flexible, but I can define termins of Reports in my application.

For example. I use the report editor (based on RichTextEditor) in HR-automation program.

I can define Groping and Sorting without open SQL for user.

index.php?t=getfile&id=3850&private=0


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37095 is a reply to message #37094] Tue, 21 August 2012 20:59 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Using previous report:
  1. I call "print report",
  2. select needed report form.
  3. fill PRE-report form.

index.php?t=getfile&id=3851&private=0


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37096 is a reply to message #37095] Tue, 21 August 2012 21:04 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Resulting report is like this:

index.php?t=getfile&id=3852&private=0

Reports table is simple database Table with TEXT field and some tags and parameters. And it's depends on application.






SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Tue, 21 August 2012 21:07]

Report message to a moderator

Re: Very Simple Report Generator (Use QTF format) [message #37097 is a reply to message #37096] Tue, 21 August 2012 21:11 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Maybe, will be interesting to define class of ReportEditor?

Procedure that printed variable reports of this appication (HR-autonation) is here:
  • Attachment: printproc.cpp
    (Size: 14.62KB, Downloaded 453 times)


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

jibe wrote on Sat, 18 August 2012 03:04

Yes, I saw that. But if the example shows how to use ##BT and ##ET and let me guess how it works, there is nothing about ##BP and ##EP. I think that a lot of people would appreciate a short explanation about that !



##BT and ##ET - body repeatable block (begin and end) in table structure ( {{ .. :: .. :: .. .... .. }} ) - automaticaly find boundary of columns.

##BP and ##EP - body repeatable block (begin and end) in plain text (may be in contract or article, for ex.)

Additionally, We can create custom body repeatable block for nested table data. (for example ##LANGBT and ##LANGET for languages, person can speaking)
This operation is very simple:
	RepGenSubProc repLangs(rep, "##LANGBT","##LANGET");
	repLangs.RepGenSubProcBody = THISBACK(PrintResume_CalcLangBody);

and definition of PrintResume_CalcLangBody
void AnketaListDlg::PrintResume_CalcLangBody() {
#undef VAR
#define	VAR(x)		rep.SubstVar("##" #x,AsString(sql[ANL_##x]));
	Sql sql;
	sql * SqlSelect(SqlAll()).From(ANKETALANGUAGE).Where(ANL_ANKETAID == gANK_ID).OrderBy(ANL_LANGUAGE);
	while (sql.Fetch()) {
		rep.RepGenCalculateBodyBeforeSubst();
		VAR(LANGUAGE);
		VAR(FINDLEVEL);
		VAR(LEVEL);
		rep.RepGenCalculateBodyAfterSubst();
	}
}



##BT and ##ET can also create variable-columns reports.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Tue, 21 August 2012 21:30]

Report message to a moderator

Re: Very Simple Report Generator (Use QTF format) [message #37100 is a reply to message #24050] Wed, 22 August 2012 00:10 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Thanks, Sergey Smile

I'll be busy tomorrow, so I'll see and try that on Thursday or Friday. I'll let you know...

I plan to use this for the reports of the application I'm developping now. I'll need also to print labels (on avery sheets). In my case, sheets have 12 rows of 4 labels, and each label shows data of one row of the database. Do you think that I could use RepGen for that ? Or adapt it ?
Re: Very Simple Report Generator (Use QTF format) [message #37101 is a reply to message #37100] Wed, 22 August 2012 01:32 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Yes. RepGen is made for this situations.

Yes We need adapt RepGen in part to define database variables and database loops and conditions. In other RepGen is fully ready to your project.

BTW, see RepGenTest - with first template. It is print labels.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37108 is a reply to message #24050] Fri, 24 August 2012 17:27 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Yes, working well now Smile

I'll see later for my label printing and let you know.

I added the french translation : see this post.

BTW : I changed in ClentCallbackCalcBody() the line
for(int STRINGS_I = 0; STRINGS_I < STRINGS_COUNT; STRINGS_I++) {

by :
while(STRINGS_I < STRINGS_COUNT) {

The increment was done twice, and STRINGS_I already declared and initialized.

[Updated on: Fri, 24 August 2012 17:42]

Report message to a moderator

Re: Very Simple Report Generator (Use QTF format) [message #37159 is a reply to message #37108] Sat, 01 September 2012 13:15 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Yes! Thanks.

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37173 is a reply to message #24050] Mon, 03 September 2012 17:32 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hello,

This report generator is great and working well Smile

As I told you, I'll have to print identification labels on Avery (TM) sheets. These labels must have a barcode. I made some first tries, combining RepGen and this small package that somebody wrote Wink

It's working fine, and I found a way to skip the first labels, in case of re-use of begun sheets. I'll try to find some time to write a test program for labels printing with barcodes.

But I have some difficulties to align well the printing with the labels. Probably, there is no other way than the trials / errors method, playing with cells and rows margins. But how can I reduce the page margin ? The left margin before the 1st cell is too large, and I don't know how to make it smaller in UWord. How can I do that ?
Re: Very Simple Report Generator (Use QTF format) [message #37179 is a reply to message #37173] Mon, 03 September 2012 21:38 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Oh. It very simple (on both questions)! (RepGen is very simple - Twisted Evil ).

1-st. I use strut: hidden column in table, wich only consist from N linefeeds with selected font size.

2-nd left and right margins can be tuning with setting paper size.

after
rep.SetTemplate(s);

place
rep.report.SetPageSize(4500,8000);


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Very Simple Report Generator (Use QTF format) [message #37182 is a reply to message #24050] Tue, 04 September 2012 09:17 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Thanks for your reply !

To adjust the alignments, it's just 1 or 2 millimeters, so I think that I'll play with column width and margins. But effectively, in some cases having hidden columns or grouping two columns is necessary.

To adjust the margins, yes : I discovered after posting that it can be done this way. I was trying to find a way to adjust page size with UWords. Too bad that it's not possible : it would be better than add page preferences in the application ! More especially when you have several reports with different page sizes !

But the problem is not with RepGen, it's with UWord... I saw that you already talked about that. I added my opinion to try to convince mirek Wink
Re: Very Simple Report Generator (Use QTF format) [message #37895 is a reply to message #24050] Tue, 20 November 2012 17:42 Go to previous messageGo to previous message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi Sergey,

Sorry that I have no time to investigate more for now...

You adviced me :

sergeynikitin wrote on Mon, 03 September 2012 21:38

left and right margins can be tuning with setting paper size.

after
rep.SetTemplate(s);

place
rep.report.SetPageSize(4500,8000);



It was possible, because at this time, there was in RepGen.h :
class RepGen  {
...
public:
	Report report;
	String *pTpl_cycle_res;
...	


But I just tried to recompile my application with the 5556 release of upp, and I get this error :
error: ‘class RepGen’ has no member named ‘report’


effectively, the "report" member is no more in RepGen.h :
class RepGen  {
...
public:
	String *pTpl_cycle_res;
...	


How can I adjust the margins now ?

Is there other changes that I'll have to adapt in my application ?

PS : Please, could you update the change log ?

Maybe you could also add the date of changes : it can be usefull for a fast check Wink
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: Thu Mar 28 10:32:49 CET 2024

Total time taken to generate the page: 0.01586 seconds