How to pass parameters to XtraReport in code

本文介绍如何在ASP.NET中使用VB.NET将参数值程序化地传递给绑定到存储过程的XtraReport。通过在Page_Load事件处理器中创建报告实例,设置所需参数值,并将其传递给ASPxDocumentViewer的Report属性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://www.devexpress.com/Support/Center/Question/Details/T254029/how-to-pass-parameters-to-xtrareport-in-code

I have a store procedure and a webform(aspx.net) with ASPxDocumentViewer1 how i can send parametters programmatic to th report.

the report is bind to the store procedure i use vb.net

Hi Francisco,

To accomplish this task, utilize the approach demonstrated in the following help topic:
How to: Silently Pass a Parameter's Value

In short, you need to create a Report instance in the Page.Load event handler, assign the required parameter values, and then pass your Report instance to the ASPxDocumentViewer.Report property:

 

[C#]

protected void Page_Load(object sender, EventArgs e) { XtraReport1 report = new XtraReport1(); report.Parameters["yourParameter1"].Value = firstValue; report.Parameters["yourParameter2"].Value = secondValue; ASPxDocumentViewer1.Report = report; }

 

https://docs.devexpress.com/XtraReports/DevExpress.XtraReports.UI.XtraReport.Parameters

This document provides general information on query parameters and describes common ways of utilizing parametrized SQL queries to filter data on the data source level.

https://docs.devexpress.com/XtraReports/17387/detailed-guide-to-devexpress-reporting/shape-report-data/use-report-parameters/query-parameters

https://docs.devexpress.com/WindowsForms/3434/controls-and-libraries/printing-exporting/examples/print-preview/how-to-preview-export-and-print-an-xtrareport

https://docs.devexpress.com/XtraReports/2596/create-end-user-reporting-applications/winforms-reporting/print-preview/quick-start/create-a-custom-print-preview

https://docs.devexpress.com/XtraReports/2595/get-started-with-devexpress-reporting/create-a-simple-data-aware-report

https://docs.devexpress.com/WindowsForms/3434/controls-and-libraries/printing-exporting/examples/print-preview/how-to-preview-export-and-print-an-xtrareport

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值