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 » U++ Library support » RichText,QTF,RTF... » Failed to set String format in report from SQLite3
Re: Failed to set String format in report from SQLite3 [message #12993 is a reply to message #12984] Tue, 04 December 2007 10:46 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fuqr wrote on Sun, 02 December 2007 22:19

My problem occured as in the following code:
=====================================================
String r_title;
try
{
SQL & ::Select(DESCRIPTION).From(CASES).Where(ID == dtid);
while(SQL.Fetch()) r_title = SQL[0];
}
catch(SqlExc &e)
{
Exclamation("[* " + DeQtfLf(e) + "]");
}



I would use:

String r_title = SQL % Select(DESCRIPTION).From(CASES).Where(ID = = dtid);


Quote:


r << " && [*= " << r_title; // problem here ???



Ideed. The trouble is that Report treats any "<<" inserted QTF separately - formatting is lost for t_title.

r << " && [*= " + r_title; // problem here ???

should work ("+" has precendence over "<<").

Anyway, one usual way is to create the whole report as String and then put into the Report. Also, consider DeQtf for r_title to remove any accidental characters used by QTF.

#include <Report/Report.h>

using namespace Upp;

GUI_APP_MAIN
{
	String r_title = "This is [MY TITLE!]";

	String qtf;
	qtf << " && [*= " << DeQtf(r_title)
	    << "&& [_= Analysis Report]&";
	
	Report r;
	r.Header("[A2> Page $$P");
	r << qtf;
	Perform(r);
}


Mirek
 
Read Message
Read Message
Read Message icon7.gif
Previous Topic: Loading Image into qtf
Next Topic: Random missing separating lines(V or H) in report table display
Goto Forum:
  


Current Time: Thu May 02 02:40:25 CEST 2024

Total time taken to generate the page: 0.01959 seconds