Custom Report Template example?

Posted by: kevin.jennings on 16 July 2025, 7:21 am EST

    • Post Options:
    • Link

    Posted 16 July 2025, 7:21 am EST

    Hello, everyone! I’m developing a web app using C# 12, .Net 8 and Blazor (the new unified Blazor). This web app will incorporate the web-based report designer included in v17 of ActiveReports.

    What I envision:

    The user can design a report template using the report designer and place objects such as image fields, text fields with constant values (i.e. Titles, Column names, etc.) and custom parameter fields (that will be passed into the report object).

    So, for example, the user places a parameter named “&BatchId” on the report. Further down the page, the user places a parameter named “&CheckImageFront” (which will be an image of a scanned check). I’m assuming that parameters need the “&” in front of the field name?

    The user will save the report template so that it can be used with another C# application to process customer data and use the report template to create the actual report. So, for instance, the C# app will say “Hey, the user wants to process Customer A. According to the database, Customer A uses a report template named CustomerARptTemplate. Let’s load that up and start filling in the blanks in the template”. It’s at this point that the C# app will pass in the parameters to the template and create a PDF report for the customer.

    So, my question(s) is this:

    In the C# program, how can I pass a value to a parameter on the template? For example, I want to send value “12345” to the &BatchID parameter and “CheckImage1.tiff” to the image parameter named “&CheckImageFront”. In C# a variable cannot begin with “&” so I’m assuming that there must be a way in the report designer to give a field an alias that is C#-safe.

    Does anyone have some sample code that illustrates sending values to parameters in a template designed with the report designer?

  • Posted 17 July 2025, 1:35 am EST

    Hi Kevin,

    >> In C# a variable cannot begin with “&” so I’m assuming that there must be a way in the report designer to give a field an alias that is C#-safe.

    In ActiveReports Web Designer, the Parameters are represented with an @ sign prefixing the parameter name.

    In C#, you may load the report in a PageReport object, and in the report, you use the pageReport.Document.Parameters collection and adding or removing parameter values based on your requirement.

    For reference, I have created a sample application and attached it along with. In the sample, I am setting the report parameter at runtime.

    Report Template.zip

  • Posted 17 July 2025, 2:48 pm EST

    Thank you so much for your help! Greatly appreciated! You went above and beyond with your answer!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels