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

Null values - SUPPORT

edited May 2004 in General
Hello,
Using RB 6.03 Pro, D6, Pragnaan export components 1.11.
I have this problem - when I export to excel Null values from the dataset
are not exported.
If I have a record with 3 fields A,B,C and a Null value in the second field
B, the result in excel is column A=field A, column B= field C, column C is
empty.
I thought the problem was with the export component, but I finally traced it
to ReportBuilder itself.
Every field with a value generates a draw command object that is passed to
the export component that renders it in the proper export format.
Unfortunately Null value fields do not generate draw commands at all and the
export component is not triggered at all in this case.
With any export format that can translate properly the x,y coordinates of
the draw command there is no problem:
Field A is put in x1 coordinate field B is not exported, field C is put in
x3 coordinate and the space starting at x2 is simply empty - consistent
with a null value. For excel this posses a problem: the exact coordinates of
the draw command cannot be mapped exactly to the very coarse resolution of
the worksheet grid. At best the fields are put into cells but if the three
fields are mapped into the same cell what happens is:
Field A is put in column A, Field B is not considered at all (Null) Field C
is mapped to cell A and because it's full it is moved to the next cell.
The result is columns A, B are filled with values A,C.

What I need is a NullToValue property (something like blankwhenzero). I
don't want to use the event ongettext for every field.
Is that possible? I need your help with changing your component to support
this property.

TIA
Israel

Comments

  • edited May 2004
    Hi Israel,

    By default, ReportBuilder will not create a draw command if the value in
    your database in Null. Try using the TppReport.NoDataBehaviors property to
    assign a message when a record is null. Then using the OnNoData event you
    can define what you would like that draw command to say. See the help file
    on TppReport.OnNoData for more information.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004
    Hi Israel,

    Sorry, I must be tired. I re-read your initial post and you mention that
    drawcommands do not get created when a record is Null. This is not true.
    I'm not sure which report components you are using but in my testing when
    printing DBText components, a TppDrawText is created even when the value is
    Null. You can see by looking at the TppDBText.GetTheText that when the
    record is Null, the value is set to an empty string, but the draw command is
    still created. If I'm completely off base here let me know. Of course the
    easiest way to solve any problem dealing with Null values is to simply
    replace them with non-Null values.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004
    Hi Nico,
    This is not a NoData event. The record exists but some of the fields are
    null.
    I thought NoData means No records = empty recordset.
    If I'm right then this is not a valid answer.
    Still waiting for your answer :)

    Israel

This discussion has been closed.