Report Script: Get object and value of a parameter

From AutoCount Resource Center
Revision as of 09:49, 21 February 2024 by DanielY (talk | contribs) (Created page with " <syntaxhighlight lang="csharp"> private AutoCount.Report.BaseReport __report; private void Report_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e) { __report = Report as AutoCount.Report.BaseReport; //Name of the parameter is "parameter1" //__report.Parameters is Parameters.ParameterCollection object param1Value = __report.Parameters["parameter1"].Value; if (param1Value != null) { label22.Text = param1Value...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


private AutoCount.Report.BaseReport __report;
private void Report_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e) 
{
    __report = Report as AutoCount.Report.BaseReport;    
    
    //Name of the parameter is "parameter1"
    //__report.Parameters is Parameters.ParameterCollection
    object param1Value = __report.Parameters["parameter1"].Value;

    if (param1Value != null)
    {
        label22.Text = param1Value.ToString();
    }
    else
    {
        label22.Text = "null";
    }
}



Go to menu

Go to top
Resources For AutoCount Software Developers