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)
Re: Very Simple Report Generator (Use QTF format) [message #25855 is a reply to message #25854] Tue, 16 March 2010 02:21 Go to previous messageGo to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 741
Registered: January 2008
Location: Moscow, Russia
Contributor

I've forgot to say. The next version will call nested queries, and will probably easily insert a table into a table or several tables to combine in a single table. Here's an example:

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

Real Code for Generate Report:
void AnketaListDlg::PrintResumeList_ReportFinish(){
	rep.SubstVar("##DATE",AsString(GetSysDate()));
	rep.SubstVar("##TOTAL",AsString(TOTAL));
}
void AnketaListDlg::PrintResumeList_CalcBody(){
	RepGenSubProc repPositions(rep, "##POSB","##POSE");
	RepGenSubProc repPositions1(rep, "##POSB1","##POSE1",true);
	RepGenSubProc repEducations(rep, "##EDUB","##EDUE");

	repPositions.RepGenSubProcBody = THISBACK(PrintResumeList_CalcPosBody);
	repPositions1.RepGenSubProcBody = THISBACK(PrintResumeList_CalcPosBody);
	repEducations.RepGenSubProcBody = THISBACK(PrintResumeList_CalcEduBody);

	Sql sql;
	
	TOTAL=0;
	sql * SqlSelect(SqlAll()).From(ANKETA);
	while (sql.Fetch()) {
		
		rep.RepGenCalculateBodyBeforeSubst();
		TOTAL++;
		gANK_ID = sql[ANK_ID];
		rep.SubstVar("##TOTAL",AsString(TOTAL));
		rep.SubstVar("##FIO",(String)sql[ANK_NAME]);
		rep.SubstVar("##NUM",AsString(sql[ANK_ID]));
		rep.SubstVar("##ANKDATE",AsString(sql[ANK_DATE]));
		rep.SubstVar("##PHONE",AsString(sql[ANK_PHONE]));
		rep.SubstVar("##PHONE1",((String)sql[ANK_PHONE])); 
		rep.SubstVar("##BIRTHDAY",AsString((Date)(sql[ANK_BIRTHDAY])));
		rep.SubstVar("##CHILDREN",AsString(sql[ANK_CHILDREN]));
				rep.SubstVar("##OWNCAR",Single<ConvYesNo>().Format(sql[ANK_OWNCAR]));
		rep.SubstVar("##SMOKER",Single<ConvYesNo>().Format(sql[ANK_SMOKER]));
		rep.SubstVar("##CANBLINDTYPE",Single<ConvYesNo>().Format(sql[ANK_CANBLINDTYPE]));
		rep.SubstVar("##SPEEDOFTYPING",AsString(sql[ANK_SPEEDOFTYPING]));
		rep.SubstVar("##SPEEDOFTYPLAT",AsString(sql[ANK_SPEEDOFTYPINGLAT]));
		rep.SubstVar("##FILEMAKING",Single<ConvYesNo>().Format(sql[ANK_FILEMAKING]));
		rep.SubstVar("##SALARY",AsString(sql[ANK_SALARY]));
		rep.SubstVar("##CURRENCY",AsString(sql[ANK_CURRENCYOFSALARY]));
		rep.SubstVar("##HOMEADDRESS",AsString(sql[ANK_HOMEADDRESS]));						//
		
		if (rep.ExistVar("##PHOTO")) {
			Image im_photo = PNGRaster().LoadString(sql[ANK_PHOTO]);
			rep.PlaceImage("##PHOTOMIN",im_photo,Size(300,300));						
			rep.PlaceImage("##PHOTOMID",im_photo,Size(800,800));						
			rep.PlaceImage("##PHOTOMAX",im_photo,Size(1200,1200));						
			rep.PlaceImage("##PHOTOEXTRA",im_photo,Size(4200,4200));						
		}

		repPositions.DoCalc();
		repPositions1.DoCalc();
		repEducations.DoCalc();
		rep.RepGenCalculateBodyAfterSubst();
	}
}

void AnketaListDlg::PrintResumeList_CalcPosBody(){
	Sql sql;
	sql * SqlSelect(SqlAll()).From(ANKETAPOSITION).Where(ANP_ANKETAID == gANK_ID);
	while (sql.Fetch()) {
		rep.RepGenCalculateBodyBeforeSubst();
		rep.SubstVar("##POSNAME",PositionConvert().Format((int)(sql[ANP_POSITIONID])));
		rep.RepGenCalculateBodyAfterSubst();
	}

}
...
...
...
...


And in header file (In Parent window TopWindow class definition):
	int TOTAL;
	RepGen rep;
	
	
	void PrintResume_ReportFinish();
	void PrintResume_CalcPosBody();
	void PrintResume_CalcEduBody();
	


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

[Updated on: Tue, 16 March 2010 02:33]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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: Sun Oct 25 06:52:23 CET 2020

Total time taken to generate the page: 0.02817 seconds