Home » Community » Newbie corner » Report & sch file
Report & sch file [message #37615] |
Fri, 26 October 2012 16:02 |
idkfa46
Messages: 155 Registered: December 2011
|
Experienced Member |
|
|
Hi guys, I have 2 questions for you today!
The first one is about Report, that's really usefull like print preview... Can I add a report in a TabCtrl instead of in Topwindow ? How?
The second and last question is about sch files. The HomeBudget example present a sch file with 4 different tables and in each one have defined "INT_ (ID) ". When i try to do the same i receive the following error:
LibSetting.obj : error LNK2005: "class Upp::SqlId ID" (?ID@@3VSqlId@Upp@@A) already defined in Legno.obj
C:\upp\out\MyUPPdrop2\MSC9.-Wall.Debug.Debug_Full.Gui.Sse2\STA.exe : fatal error LNK1169: one or more multiply defined symbols found
defining diffent ID names like:
INT_ (ID)
INT_ (ID2)
INT_ (ID3)
I can compile it correctly! why???
Regards,
Matteo
|
|
|
Re: Report & sch file [message #37616 is a reply to message #37615] |
Fri, 26 October 2012 17:34 |
|
idkfa46 wrote on Fri, 26 October 2012 16:02 | The second and last question is about sch files. The HomeBudget example present a sch file with 4 different tables and in each one have defined "INT_ (ID) ". When i try to do the same i receive the following error:
LibSetting.obj : error LNK2005: "class Upp::SqlId ID" (?ID@@3VSqlId@Upp@@A) already defined in Legno.obj
C:\upp\out\MyUPPdrop2\MSC9.-Wall.Debug.Debug_Full.Gui.Sse2\STA.exe : fatal error LNK1169: one or more multiply defined symbols found
|
Hi Matteo,
If you look more closely on the sch file in HomeBudget, you'll find out that it actually contains only one "INT_(ID)" and three "INT(ID)". The difference is that the variant with '_' defines a global SqlId with the same name, which can be obviously present only once, else you get error about multiple symbols with same name when linking.
So the solution is to either use unique column names, or use INT_ macro for one of them only and define the rest with INT. Just for completeness: the columns defined with INT can be accessed as "ID.Of(TABLENAME)".
The report part of the question will have to wait for someone else, I don't know report good enough to answer Maybe it would be better if you posted each question as separate thread next time
Best regards,
Honza
|
|
|
Re: Report & sch file [message #37618 is a reply to message #37615] |
Sat, 27 October 2012 00:29 |
omari
Messages: 265 Registered: March 2010
|
Experienced Member |
|
|
Hello,
to add a report in a TabCtrl, use ReportView class.
this is a demo:
#include <CtrlLib/CtrlLib.h>
#include <Report/Report.h>
using namespace Upp;
class ReportInTabCtrl : public TopWindow {
public:
typedef ReportInTabCtrl CLASSNAME;
TabCtrl tab;
Button bPrint;
ReportView rv;
Report r;
ReportInTabCtrl()
{
tab.Add(rv.HSizePosZ(0, 0).VSizePosZ(0, 0), "Preview");
tab.Add(bPrint.LeftPos(10, 60).TopPos(10, 20), "Print");
Add(tab.HSizePosZ(10, 10).VSizePosZ(10, 10));
bPrint.SetLabel("Print");
bPrint <<= THISBACK(BPrint);
r.Header("[A2> Page $$P");
r << "This is some [* QTF text";
rv.Set( r);
}
void BPrint()
{
Print(r, rv.GetFirst(), "printing..");
}
};
GUI_APP_MAIN
{
ReportInTabCtrl().Run();
}
regards
omari.
regards
omari.
|
|
|
|
Goto Forum:
Current Time: Sat Apr 27 09:06:57 CEST 2024
Total time taken to generate the page: 0.02026 seconds
|