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

Error after upgrade from RB 7 to RB 12

edited September 2011 in Datapipelines
We are using Delphi 7, SQL Server and ADO, we have been using RB 7 for 5
years or so.
We recently upgraded to RB 12.0 and we are experiencing the following
issue after the upgrade:
- We have an ADO Query executing a stored procedure with a bunch of
parameters, the Query is hooked to a Pipeline and the Pipeline to a Report.
- The Delphi code populates the Query parameter and assigns the Pipeline
to the report
- When the Print method is executed in the report, I am getting an SQL
error, using profiler I can see that the stored procedure is executed
without parameters, something like this "EXECUTE
cspGetCustomerSummaryReport @RegionID= "
- After you click OK in the SQL error the stored procedure is executed
with the correct parameters and the report runs correctly.

How can I fix this in RB12?

This is the SQL in qryMain: 'exec cspGetCustomerSummaryReport :RegionID'

Note that inside of the report in the datapage there is
TqdvADOStoredProc using cspGetCustomerSummaryReport.

This is a simplified example
qryMain: TADOQuery;
plMain: TppDBPipeline;
ppCustomerReport: TppReport;


procedure
TCustomerSummaryReportProc.PrintReport(aTemplateName:shortstring);
var
oPrinter : TppPrinter;
begin

// give the report template name
fCusSumDM.ppCustomerReport.Template.DatabaseSettings.Name :=
aTemplateName;

fCusSumDM.ppCustomerReport.Template.LoadFromDatabase;

// Set ShowAutoSearchDialog to false so that sp parameter prompt is
disabled
fCusSumDM.ppCustomerReport.ShowAutoSearchDialog := False;

if fCusSumDM.qryMain.Active then
begin
fCusSumDM.qryMain.Close;
end;

//give parameters their values
fCusSumDM.qryMain.Parameters.ParamByName('RegionID').Value := 'TEST';


// set the datapipeline for the report
fCusSumDM.ppCustomerReport.DataPipeline := fCusSumDM.plMain;

fCusSumDM.ppCustomerReport.Print;
end;

Thanks in advance

Comments

  • edited September 2011
    Hi Miguel,

    If you remove ReportBuilder from the equation and just try to execute
    your stored procedure with a DBGrid perhaps do you get the correct
    output? Try getting everything working without ReportBuilder, then add
    the pipelines, reports, etc. into the mix.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2011
    UPDATE:
    I just checked what RB7 used to do and it does something very similar to
    RB12, the difference is that RB7 executes the stored procedure but fills
    the parameters with NULL and RB12 does nothing with the parameters


    RB 7
    "EXECUTE cspGetCustomerSummaryReport @RegionID= NULL"


    RB12
    'EXECUTE cspGetCustomerSummaryReport @RegionID= "


  • edited September 2011
    Nico,
    Everything works correctly without Report Builder, it used to work
    with Report Builder 7 and no other changes have been done.

    Thanks

    Miguel

  • edited September 2011
    Hi Miguel,

    I'm sorry but I'm a bit unclear about which features of ReportBuilder
    you are using. Are you using DADE (Data workspace) to access your data
    or simply connecting a datapipeline to the report? You mention that
    ReportBuilder is not assigning the correct parameters for your stored
    proc. How are you giving the dataset the parameter values in the first
    place? Through the autosearch feature? Are you using Report Parameters?

    Perhaps give me more information about exactly how your application
    works and I'll be able to see where the problem is.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2011
    Nico,
    I am using an ADOQuery (executes a stored proc with parameters), a
    TppDBPipeline and a TppReport.(ADOQUERY-->PipeLine-->Report)

    - My Delphi GUI populates the parameters for the ADOQuery
    - Opens the ADOQuery (Stored Procedure is executed).
    - The Datapipeline is Assigned to the report.
    - The Print method is executed for the report. At this point the stored
    procedure is executed Again but with no parameters

    RB 7
    "EXECUTE cspGetCustomerSummaryReport @RegionID= NULL"


    RB12
    'EXECUTE cspGetCustomerSummaryReport @RegionID= "

    Miguel


  • edited September 2011
    I think I found my problem after getting the following e-mail from the
    Tech Support guys at Digital Metaphors

    *****************************
    Miguel,

    ReportBuilder 11 introduced enhancements to the SQL so that :ParamName
    refers to Report.Parameters[ ] items and the value is automatically
    substituted. I suspect that the new features are affecting the behavior
    of your custom solution.

    Here are links to details about the new features

    http://www.digital-metaphors.com/rbWiki/General/What's_New/RB_11/Parameters_and_AutoSearch


    http://www.digital-metaphors.com/rbWiki//General/What's_New/RB_11/DADE
    ***************************

    We had some custom code setting manually the report parameters, I
    removed that code and now parameters are being set correctly by RB


    Thanks

    Miguel






This discussion has been closed.