Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Problem with Header & Footer
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with Header & Footer

 Post Reply Post Reply
Author
Message
zaksoft View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Topic: Problem with Header & Footer
    Posted: 15 September 2007 at 7:39am
Just open your ReportControl.ReportSample and insert both align and newline in Header and/or footer...
 
You can try this (space before and after control bytes to enhance reading - some result without)
 
Header: >>>
Row1 Left &b Row1 Center &b Row1 Right \n Row2 Left &b Row2 Center &b Row2 Right \n Row3 Left &b Row3 Center &b Row3 Right
<<<
 
Footer: >>>
Footer 1 Left \n Footer 2 Left &b Footer 2 Center \n This is third line
<<<
 
 
VS2008 SP1 - VS2010 SP1 - VS2012 - MFC MBCS Statically linked
XTP 15.3.1 Static Link
---------------------------------------------------------
Davide Zaccanti - ZakSoft - www.zaksoft.com
Back to Top
zaksoft View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2007 at 7:03am
Simpler example:
 
insert into header:
 
Row1\n&bRow2
 
Hope this help to solve the problem-
VS2008 SP1 - VS2010 SP1 - VS2012 - MFC MBCS Statically linked
XTP 15.3.1 Static Link
---------------------------------------------------------
Davide Zaccanti - ZakSoft - www.zaksoft.com
Back to Top
zaksoft View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2007 at 10:41am

The core of the solution is _SplitFormatLCR() on xtpdrawhelpers.cpp.

The solution is to write R1 C1\nR2 C1\nR3 C1&bR1C2\n\nR3C2&bR1C3; pratically instead of inserting from left to right and from top to bottom the function split only column dividers ( &b) and the renderer leaves newlines.... You have to insert from top to bottom and then repeat for each column-
I think this must be adjusted in future release, at present I've made my own function to split in the usual way.
VS2008 SP1 - VS2010 SP1 - VS2012 - MFC MBCS Statically linked
XTP 15.3.1 Static Link
---------------------------------------------------------
Davide Zaccanti - ZakSoft - www.zaksoft.com
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2007 at 6:03pm

Hi,

Your logic looks strange for me. You call this as a usual way, but where is it usual?

Our logic is following:

- Using &b tag you can divide string for 3 parts: left, center, right.

- Each part is processed separately.

EXAMPLE:

Row1 Left \n Row2 Left \n Row3 Left &b Row1 Center \n Row2 Center \n Row3 Center &b Row1 Right \n Row2 Right \n Row3 Right

 

This logic looks easy and I don’t want to change it at least for compatibility reasons. But I can add some notification from CXTPPrintPageHeaderFooter::FormatTexts to allow customizing of this behavior.

I mean in this event you will get string in format which you like and convert it to format which I like . This looks like a more universal solution.  Somebody may support custom parameters using this mechanism.

--
WBR,
Serge

Back to Top
zaksoft View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2007 at 12:37am
In all program if you set both column breakers and line breakers you can mix them, in many program I use I set ( as I read and write)
 
Row1 Left &b Row1 Center &b Row1 Right  \n Row2 Left \n &b Row2 Center &b Row2 Right  \n Row3 Left &b Row3 Center &b Row3 Right \n &b &b Row4 Right
 
I can of course change as I did the format function, but if
_SplitFormatLCR() simply take in account both &b and \n ( now only &b are interpreted) will be a great enhancement and a simpler approach for the user that can enter as above in a PageSetup procedure like the one you oprovide in example.
 
Thanks,
VS2008 SP1 - VS2010 SP1 - VS2012 - MFC MBCS Statically linked
XTP 15.3.1 Static Link
---------------------------------------------------------
Davide Zaccanti - ZakSoft - www.zaksoft.com
Back to Top
zaksoft View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2007 at 12:41am
Sorry for the wrong string, of course after Row2 Left there is no line break, the correct one (an more user friendly) is
 
Row1 Left &b Row1 Center &b Row1 Right  \n Row2 Left &b Row2 Center &b Row2 Right  \n Row3 Left &b Row3 Center &b Row3 Right \n &b &b Row4 Right
 
Thanks again for your support.
VS2008 SP1 - VS2010 SP1 - VS2012 - MFC MBCS Statically linked
XTP 15.3.1 Static Link
---------------------------------------------------------
Davide Zaccanti - ZakSoft - www.zaksoft.com
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.