C#/Visual C# 코드 리뷰
Xtrareport 연동
webit22
2021. 7. 29. 12:13
728x90
/* Main Form */
string strPara = txtRelation.Text.ToString();
string strFrDt = cboFrDt.Text.ToString();
string strToDt = cboToDt.Text.ToString();
// xr01 이름인 xtra report의 객체 xrREPORT 생성
xr01 xrREPORT = new xr01(dtRtn, strPara, strFrDt, strToDt);
xrREPORT.ShowPrintMarginsWarning = false;
xrREPORT.RequestParameters = false; // Hide the Parameters UI from end-users.
DevExpress.XtraReports.UI.ReportPrintTool rpt = new DevExpress.XtraReports.UI.ReportPrintTool(xrREPORT);
rpt.AutoShowParametersPanel = false;
rpt.ShowPreviewDialog();
/* xtrareport (xr01) 소스코드 */
public xr01(System.Data.DataTable pdt, string relPID, string strFrDt, string strToDt)
{
InitializeComponent();
// data row 값 전달
foreach (System.Data.DataRow dr in pdt.Rows)
{
this.dataSet11.MainForm.ImportRow(dr);
}
// 파라미터로 값 전달
this.Parameters["strToDt"].Value = strToDt;
}
* Field List에서 파라미터 추가하기 (column명 "strToDt"랑 파라미터 이름이 동일해야함)
728x90