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++ » U++ TheIDE and Library: Releases and ChangeLogs » Report::Margins
Report::Margins [message #4411] Sat, 05 August 2006 17:32 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Report& Margins(int top, int left);

If set, sets the placement of logical page inside physical one.

Default, Null, centers the page.

Mirek
Re: Report::Margins [message #4413 is a reply to message #4411] Sat, 05 August 2006 17:44 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

Is that in dots? (I guess you haven't synced it to UVS yet Wink)

[Updated on: Sat, 05 August 2006 17:49]

Report message to a moderator

Re: Report::Margins [message #4414 is a reply to message #4413] Sat, 05 August 2006 17:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes.

Mirek
Re: Report::Margins [message #4429 is a reply to message #4414] Sun, 06 August 2006 20:06 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

Does not seem to work right for me... is it only applying it to the top and left? Or am I using it wrong?
#include <CtrlLib/CtrlLib.h>
#include <Report/Report.h>

GUI_APP_MAIN
{
	String qtf;
	Vector<String> data;
	int rows=4;
	int cols=3;
	int i;
	
	double leftMargin=1.0;
	double topMargin=.5;

	Report report;
	report.Margins(topMargin*600,leftMargin*600);
	
	Size sz=report.GetPageDots();
	int rowheight=sz.cy/rows;
	
	for(i=1;i<(rows*cols+1);i++)
		data.Add("cell "+AsString(i));
	
	qtf << "[ $$0,0#00000000000000000000000000000000:Default]";
	qtf << "[{_}\r\n";
	qtf << "[ {{500";
	for(i=1;i<cols;i++)
		qtf << ":500";
	qtf << "H" << rowheight << "l/0r/0t/0b/0 ";
	
	// Cell one doesn't start with ::
	qtf << "[s0;= " << data[0] << "]\r\n";
	
	for(i=1;i<data.GetCount();i++)
	{
		qtf << ":: [s0;= " << data[i] << "]\r\n";
	}
	qtf << "}}]\r\n";
	
	report << qtf;
	Perform(report);
}
Re: Report::Margins [message #4432 is a reply to message #4429] Sun, 06 August 2006 21:12 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Works OK for me.

Anyway, I guess I see what is wrong. Indeed, this is simply offset of logical page in physical page, nor right and bottom margins.

To get right and bottom margins right, set the page size.

Mirek
Previous Topic: Linux fixes...
Next Topic: RichText/QTF minimal cell height
Goto Forum:
  


Current Time: Thu Apr 18 06:31:56 CEST 2024

Total time taken to generate the page: 0.01512 seconds