|
|
Home » Developing U++ » UppHub » Very Simple Report Generator (Use QTF format)
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #26142 is a reply to message #26141] |
Mon, 05 April 2010 18:35   |
|
Hi Luigi!
It's very strange.
I think, that it some mistakes in client code.
In Report generator all very simple and cannot work wrong.
I propose to send me testcase (if it's close source you may send direct to my mail (mail at svsoft . ru) ).
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #26167 is a reply to message #26142] |
Wed, 07 April 2010 03:42   |
|
Hi Luigi!
I looked at the code, code - perfect. The whole thing was in the wrong QTF.
I did the following: just opened two windows - I looked at one window, and drew the same report template in another window.
New QTF file in attachment.
##TOTAL - I added some code for debugging purposes. Here's a modified piece of code.
void ClentCallbackCalcBody() {
LOG("ClentCallbackCalcBody");
Vector<String> V = Split(STRINGS[STRINGS_I],';',false);
DUMPC(V);
rep.SubstVar("##PLAYERNAME",TrimBoth(V.At(0)));
rep.SubstVar("##COUNTRY",TrimBoth(V.At(1)));
rep.SubstVar("##TITLE",TrimBoth(V.At(2)));
rep.SubstVar("##RTGFIDE",TrimBoth(V.At(3)));
rep.SubstVar("##RTGNAT",TrimBoth(V.At(4)));
rep.SubstVar("##TOTAL",AsString(TOTAL)); // <===== I added only this line
String pictaddr;
/* if (V.GetCount()>=8 && !TrimBoth(V.At(7)).IsEmpty()) {
pictaddr = TrimBoth(V.At(7));
if (!pictaddr.IsEmpty()) {
#ifdef PLATFORM_X11
pictaddr = GetHomeDirectory()+"/MyApps/RepGenTest/"+pictaddr;
DUMP(pictaddr);
#endif
Image im = StreamRaster::LoadFileAny(pictaddr);
rep.PlaceImage( "##IMAGE", im, Size(1100,700) );
// rep.PlaceImage( "##IMAGE", im );
}
} else {
rep.SubstVar("##IMAGE","");
}
*/
TOTAL += 1;
if(++STRINGS_I==STRINGS_COUNT) rep.LoopDone();
};
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
[Updated on: Wed, 07 April 2010 03:45] Report message to a moderator
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #26168 is a reply to message #26167] |
Wed, 07 April 2010 08:04   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
sergeynikitin wrote on Wed, 07 April 2010 03:42 | Hi Luigi!
I looked at the code, code - perfect. The whole thing was in the wrong QTF.
|
Thank you!
It works now. I am sorry for the false allarm.
Just a little note. Depending on the height of the template table may happen that it is broken over two consecutive pages. Perhaps it would be better to try to keep it on the same page.
Luigi
[Updated on: Wed, 07 April 2010 08:26] Report message to a moderator
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #26169 is a reply to message #26168] |
Wed, 07 April 2010 09:33   |
|
Unfortunately, a breakdown of the content on the page controls package Report (RepGen falls to slightly modify the original QTF).
Here's another version of the report template using the Option "Keep table together" in parent table.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #30551 is a reply to message #30548] |
Sat, 08 January 2011 10:18   |
|
mubeta wrote on Fri, 07 January 2011 22:26 | Hi all,
I am looking for RepGen, that is what I am searching to do before to find it.
Only one question: the QTF template file are made by what ? My problem is that I don't found any way to insert an image directly from file (I have to open the image from a different editor and copy/paste to the qtf file...), using UWord that is coming with U++. There is any suggestet tool ?
Yhanks.
|
You can do this without problems.
Array<QtfRichObject> v_qtf_objects;
Image v_image_data = <your image>
v_qtf_objects.Add(CreatePNGObject(v_image_data, 0, 500));
String v_image_str = "";
v_qtf_objects.Add(CreatePNGObject(v_image_data, 0, 500));
v_image_str << v_qtf_objects[v_qtf_objects.GetCount()-1];
v_rep_body = replace_string(v_rep_body, "##ImageData", v_image_str);
The v_rep_body is you template string with image.
OK, I did a costumized template generator, but the idea is same, I think.
Best regards, Ion.
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #30560 is a reply to message #30551] |
Sat, 08 January 2011 15:21   |
mubeta
Messages: 77 Registered: October 2006
|
Member |
|
|
Thanks for all,
Maybe the RepGen, (downloaded from the repository), have a bug at the lines 42 and 44: where "SubstVar("##IMAGE",s);" must be replaced with: "SubstVar(s_from,s);" for best costumization.
Now I am looking for use repeated parts of the report body. Two questions:
1) In the example "RepGenTest" is not clear (for me), what ##EP, ##ET, ##BP and ##BT tags are used for.
2) In the same example, the template file named: REPORT_TEMPLATE.QTF there is some very small tables, or table cells, (apparently not visible). Are used for something regarding RepGen automation ?
Thanks.
|
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #30776 is a reply to message #30590] |
Fri, 21 January 2011 20:12   |
|
RepGen is very old in SVN. I'll upload new version with extremely new technique of loop processing (and very simplest).
If you want, you may use UWord. Usually I add same editor in application and I save templates in database.
Maybe I upload RepGen with GUI template editor?
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Re: Very Simple Report Generator (Use QTF format) [message #37071 is a reply to message #24050] |
Fri, 17 August 2012 19:04   |
 |
jibe
Messages: 294 Registered: February 2007 Location: France
|
Experienced Member |
|
|
Hi,
Is this working well ? I compiled (rebuilt all) the RepGen_Test, and it doesn't generates a good report (see attached pdf).
I'm using last version (5283) of Upp, the Data.csv file for test seems good as well as QTF report files...
I don't understand what I'm doing wrong... What happens ?
The 2 reports look very similar, just 2 pages and some very little changes for the other, but no data corresponding to data.csv...
PS : could you explain more how to use ##BP, ##BT, ##EP and ##ET, please ? (already asked by mubeta) It could be good that it is mentioned in the doc
[Updated on: Fri, 17 August 2012 19:07] Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 17:56:32 CEST 2025
Total time taken to generate the page: 0.01464 seconds
|
|
|