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

Datatype of database field changed from integer to bigint. How to update the reports

Hi,

In the database the requirement for a field changed so I had to change the datatype from integer to bigint. Several reports use this field.

When I open the report and preview the report, field values above maxint are displayed wrong. Understandable because the datatype is still integer. I can remove and add the field from query using the Query Designer and it is solved.

Why is this a problem when going from integer to bigint and not when increasing the length of a varchar field
Is there an easier way to convert these reports? Something like a refresh with metadata from the database. I’ve to change more than 100 reports…

Using D2007, RB14.08 and a Firebird IBX database for this project.
Kind regards,

Jeroen Röttink
JR-soft software solutions

Comments

  • Hi Jeroen,

    Try implementing Report.Template.OnLoadEnd to iterate over the QueryDataViews and call QueryDataView.OutOfSync for each one.

    Here's an rbWiki example of How to iterate over the DatViews

    http://rbwiki.digital-metaphors.com/dade/fundamentals-dade/how-to-search-available-dataviews/

    Once you get it working, try writing a conversion utility to iterate over the rbItems database, load each report template, convert and save.

    For others following this thread, Jeroen has an active RB license, qualifies for tech support.

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi Nard,

    I tested this by calling below procedure from OnLoadEnd, but this did not the trick. Seems the underlying TdaSQL is not refreshed.

    procedure RefreshDADE(AReport: TppReport);
    var
    DataModule: TdaDataModule;
    X: integer;
    begin
    DataModule := daGetDataModule(AReport);
    if Assigned(DataModule)
    then begin
    for X := 0 to DataModule.DataViewCount-1
    do DataModule.DataViews[X].OutOfSync;
    end;
    end;
    Kind regards,

    Jeroen Röttink
    JR-soft software solutions
  • Hi Jeroen,

    I researched further and sent you an example. The solution requires updating the TdaSQL fields and then refreshing the DataView DBPipeline fields.

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi Nard,

    Thank you for researching this and finding a solutions. Works perfect!
    Kind regards,

    Jeroen Röttink
    JR-soft software solutions
Sign In or Register to comment.