Stored Procedure parameters...

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Re: Stored Procedure parameters...

DynamicPDF CoreSuite for .NET (v7) Forum

 Mar 29 2013 7:07 PM
I have a simple report as follows:

<?xml version="1.0"?>
<document xsi:schemaLocation="http://www.cete.com http://www.cete.com/schemas/DPLX60.xsd" version="6.0" id="Document1" author="" keywords="" title="" subject="" xmlns="http://www.cete.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <report id="Report1" pageOrientation="landscape">
    <query id="Query1">
      <storedProcedure dataProvider="msSql" referenceParameter="" connectionString="Institution" name="[InstCllctn].[dbo].[pr_RPT_AchvmtCmpct]">
        <parameter type="bigInt" value="" name="@CllctnID"/>
        <parameter type="bigInt" value="" name="@InstID"/>
      </storedProcedure>
    </query>
    <template id="Template1"/>
    <header id="Header1" height="50"/>
    <detail id="Detail1" height="579">
      <recordBox id="RecordBox2" dataFormat="" height="14" field="InstNm" width="271" x="176" y="22"/>
    </detail>
    <footer id="Footer1" height="50"/>
  </report>
</document>

If I set a value for the parameters in the query window, then it passes the parameters into the stored procedure as expected...so presumably the report is configured correctly.

In my vb application, I'm trying to pass the values for those parameters in as follows:

Dim dl As DocumentLayout = New DocumentLayout("C:\TestPDF.dplx")
Dim parameters As ParameterDictionary = New ParameterDictionary()
parameters.Add("CllctnID", 826)
parameters.Add("InstID", 2244)
Dim doc As Document = dl.Run(parameters)

But the proc gets called with "default" for both parameters.  Can anyone tell me what is the proper way to set the value of the parameters?
 Apr 01 2013 7:53 AM
Posted by a ceTe Software moderator
Hello,

The code you are using looks fine for setting the Parameter values. However the XML you sent for the dplx has no values for the parameters you have added.

<parameter type="bigInt" value="" name="@CllctnID"/>

In the above line there is no parameter value mentioned. Below is the correct syntax for this.

<parameter name="@CustomerID" type="nChar" size="5" value="#Parameters["CustomerID"]#"/>

The value mentioned here will be replaced by the value given in code. Otherwise the default values will be taken from the procedure.

You can also refer to the help documentation on adding the parameters from designer and setting values from code.

Thanks,
ceTe Software Support Team.
 Apr 01 2013 11:29 AM
Hi,

That worked.  Thanks!

All times are US Eastern Standard time. The time now is 3:50 AM.