Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

trouble with Grouping

edited August 2005 in General
Hi everyone
I was wondering if anyone could help me or tell me if what I am trying to do
is not possible with the Report Builder 9.02 standard edition
I am trying to create a report whose datafields change as each new line of
detail is printed.
I thought I could create a group based on a custom field (a label that
contains a date that changes as each row of data changes)
I am having trouble figuring out where I should be executing the code to
change the data month label so the next line of data will be printed and
where I should be execting the code to say what datafields the dbtexts are
linked to

Is this something that can be done with my standard edition. I have used
grouping before but not where I am trying to displays data where rows are
month/years and columns contains the data


An example of how I am trying to display my data is
My field names are consistent
SALE_M1 is May05
SALE_M2 is Apr05
SALE_M3 is Mar05

it follows through to all column names in my table QTA_M1,QTA_M2,QTA_M3,
etc


I have the code to figure of what field should be used and how to figure
date, but I am not sure where to put it so that it changes correctly. I keep
getting only the first row of data

my code for field changes is
dbCM.DataField:=
dm_main.dtaSalesExport.DataSet.FieldByName('SALE_M'+inttoStr(nMonthCtr)).Dis
playName;

dbQuota.DataField:=dm_main.dtaSalesExport.DataSet.FieldByName('QTA_M'+inttoS
tr(nMonthCtr)).DisplayName;
dbAttain.DataField:=
dm_main.dtaSalesExport.DataSet.FieldByName('ATT_M'+inttoStr(nMonthCtr)).Disp
layName;
dbLYM.DataField:=
dm_main.dtaSalesExport.DataSet.FieldByName('LYM_M'+inttoStr(nMonthCtr)).Disp
layName;
dbGrow.DataField:=
dm_main.dtaSalesExport.DataSet.FieldByName('GRW_M'+inttoStr(nMonthCtr)).Disp
layName;
dbM_MS.DataField:=
dm_main.dtaSalesExport.DataSet.FieldByName('MS_M'+inttoStr(nMonthCtr)).Displ
ayName;
dbLY_MS.DataField:=
dm_main.dtaSalesExport.DataSet.FieldByName('LYMS_M'+inttoStr(nMonthCtr)).Dis
playName;

my code for date change -The code for increment or decrement of month and
year may occur before or after the label is set. It will depend on when we
actually set the caption of the label

sdate:=IntToStr(nDYear);

If nDMonth = 1 then
begin
nDMonth:=12;
nDYear:= nDYear-1;
end
else
nDMonth := nDMonth-1;

sColLabel:= UpperCase(caMonth[nDMonth]) +rightstr(sdate,2);
lbldatatime.Caption:= sColLabel;

Date Sales Quota Attainment LastMonthData Growth
MarketShare LastYear Market Share
May05
Apr05
Mar05

Any help would be appreciated
K

Comments

  • edited August 2005
    Hi K,

    ReportBuilder was not designed to handle dynamic data during the generation
    process. This tends to confuse the report engine and give adverse output.
    RB definitely handles itself better when all data processing is done before
    the report is printed (i.e. before Report.Print is called). My suggestion
    would be to create a separat (in-memory perhaps) dataset for the dates and
    either join or link that dataset to the dataset containing your sale
    records. This way ReportBuilder can simply traverse your data and break a
    group after each data field.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.