Cross Tab Reports
Dear friends...
The Cross Tab Report ability in Report Builder is great but I need to use
the methods provided to change labels for totals and fields in the report.
However I?ve tried the Tutorial it runs short on saying how to accomplish it
and I have not found much info on it elsewhere.
Can anyone tell me where can I find complete and precise info on how to
change what the Cross Tab says, for example Total instead of Sum of
or Grand Total of... ?
I sent a message about a month ago to Digital Metaphors including some code
of my own but so far no answer.
I will really appreciate your help a lot.
Sincerely,
Gerardo.
gerardou@xygnus.com
The Cross Tab Report ability in Report Builder is great but I need to use
the methods provided to change labels for totals and fields in the report.
However I?ve tried the Tutorial it runs short on saying how to accomplish it
and I have not found much info on it elsewhere.
Can anyone tell me where can I find complete and precise info on how to
change what the Cross Tab says, for example Total instead of Sum of
or Grand Total of... ?
I sent a message about a month ago to Digital Metaphors including some code
of my own but so far no answer.
I will really appreciate your help a lot.
Sincerely,
Gerardo.
gerardou@xygnus.com
This discussion has been closed.
Comments
I apologise for not responding to your initial question. As a rule of
thumb, we try to respond to all questions within 24 hours. We do however
receive hundreds of e-mails daily (much of it spam) so it is a posibility
that your message was filtered by mistake. In the future, if you do not
receive a responce from us in 24 hours, please re-send the e-mail or post
the question out here and we'll get right to it .
You will find that the CrossTab component is extensively documented in the
ReportBuilder help. Start by searching for the help topics on TppCrossTab
and TppMatrix. These will guide you through the different aspects of a
crosstab. There are also numerous CrossTab demos located in the
\RBuilder\Demos\2. CrossTabs\... directory. Demos 121 - 127 show how to add
custom values to some of the CrossTab cells.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thank you for respondig.
I will repost the code initially sent. I have been playing with those demos
and with the Help but can not get what I need no matter what I try. Perhaps
an small push will do... contact you later (I am on the run right now).
Regards
Ok, here I come again. The following lines show you my simple code. All I
have been doing is playing with the methods but I have not been able to make
what I need which is to change the second column label (blank instead of
Data) and something like Total or Subtotal instead of Sum of .
Please tell me which method will lead me to achieve my objective.
Your help is greatly appreciated.
Regards
----------------------------------------------------------------------------
-------------------------------------------
{Project contains only a button, a ppReport, dataSource, query and pipeline.
ppReport contains only one crossTab in the Header band}
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ppPrnabl, ppClass, ppStrtch, ppCTMain, ppBands, ppCache, ppDB, Db,
Wwdatsrc, DBTables, Wwquery, ppDBPipe, ppComm, ppRelatv, ppProd, ppReport,
StdCtrls;
type
TForm1 = class(TForm)
ppReport1: TppReport;
ppDBPipeline1: TppDBPipeline;
wwQuery1: TwwQuery;
wwDataSource1: TwwDataSource;
ppHeaderBand1: TppHeaderBand;
ppDetailBand1: TppDetailBand;
ppFooterBand1: TppFooterBand;
ppCrossTab1: TppCrossTab;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure ppCrossTab1GetDimensionName(Sender: TObject;
aDimension: TppDimension; var aName: String);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
ppReport1.print;
end;
procedure TForm1.ppCrossTab1GetDimensionName(Sender: TObject;
aDimension: TppDimension; var aName: String);
begin
if (aDimension is TppValueDef)
then if aDimension.ComponentIndex = 1 then aName := 'QQOro 1';
end;
end.
----------------------------------------------------------------------------
-------------------------------------------
An easy way to change the caption of a value def in the crosstab is to use
the OnGetCaptionText event. For example, you could do something like the
following...
procedure TForm1.ppCrossTab1GetCaptionText(Sender: TObject;
aElement: TppElement; aColumn, aRow: Integer;
const aDisplayFormat: String; aValue: Variant; var aText: String);
begin
if (aColumn = 0) and (aRow = 0) then
aText := 'Subtotal';
end;
See the help for TppElement for a diagram of the individual parts of a
CrossTab object. Most of these classes are located in the ppCTMain.pas file
if you wish to look at the source.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com