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 » ArrayCtrl, HeaderCtrl & GridCtrl » Export Ctrl to qtf table
Export Ctrl to qtf table [message #33913] Sun, 25 September 2011 22:05 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I tried to find without success some method to export the whole content of an ArrayCtrl/GridCtrl to a qtf table. Does really is it absent some smart way? I can't believe Smile

Luigi
Re: Export Ctrl to qtf table [message #33931 is a reply to message #33913] Tue, 27 September 2011 18:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Sun, 25 September 2011 16:05

Hello,

I tried to find without success some method to export the whole content of an ArrayCtrl/GridCtrl to a qtf table. Does really is it absent some smart way? I can't believe Smile

Luigi


It is missing because while there is a nice logical way how to do that, results usually are not very good... Smile

In any case, the code is trivial. Well, maybe we could have it in ArrayCtrl after all. Add to RM, nice easy task...

Mirek
Re: Export Ctrl to qtf table [message #33934 is a reply to message #33931] Tue, 27 September 2011 19:16 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
mirek wrote on Tue, 27 September 2011 18:29

forlano wrote on Sun, 25 September 2011 16:05

Hello,

I tried to find without success some method to export the whole content of an ArrayCtrl/GridCtrl to a qtf table. Does really is it absent some smart way? I can't believe Smile

Luigi


It is missing because while there is a nice logical way how to do that, results usually are not very good... Smile

In any case, the code is trivial. Well, maybe we could have it in ArrayCtrl after all. Add to RM, nice easy task...

Mirek


I can imagine that the final qtf maybe not the best when the column are a lot and the horizontal space is not in sync with the character size.
I had always problem to find the right font size to let the table fit the A4 page. Finally I decided to save in qtf only the first N column to have an acceptable quality. As usual my users found very important the hided columns Smile
I would be not warried if an eventual
array.ExportQtf(filename);
will not work at all in all cases.
Perhaps some minimum tuning would be nice, I mean the possibility to choose the font size to let the user try different view before to print.

Thanks a lot!
Luigi
Re: Export Ctrl to qtf table [message #33952 is a reply to message #33934] Fri, 30 September 2011 13:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Added a couple of functions:

#include <CtrlLib/CtrlLib.h>
#include <Report/Report.h>

using namespace Upp;

GUI_APP_MAIN
{
	ArrayCtrl a;
	a.AddColumn("First");
	a.AddColumn("Second");
	a.AddColumn("Third");
	for(int i = 0; i < 100; i++) {
		a.Add(i, GetSysDate() + i, FormatIntRoman(i));
		if(i % 3 == 0)
			a.Select(i);
	}
	a.MultiSelect();
	a.SetClipboard();
	
	TopWindow win;
	win.Add(a.SizePos());
	win.Run();
	
	QtfReport(a.AsQtf() + "&&" + a.AsQtf(false, false));
	SaveFile("u:/ac1.csv", a.AsCsv());
	SaveFile("u:/ac2.csv", a.AsCsv(true, ',', false));
}
Re: Export Ctrl to qtf table [message #33965 is a reply to message #33952] Sat, 01 October 2011 14:23 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
mirek wrote on Fri, 30 September 2011 13:19

Added a couple of functions:



They are great!
Thanks a lot. It is much more easier to fill an ArrayCtrl and get for free the the qtf.

Luigi
Previous Topic: ArrayCtrl copy to the Clipboard
Next Topic: [SOLVED] GridCtrl sql update
Goto Forum:
  


Current Time: Fri Apr 19 17:45:40 CEST 2024

Total time taken to generate the page: 0.01980 seconds