简体   繁体   English

在 winform 应用程序运行时更改用户输入的报告标题文本框值

[英]Changing report header textbox value from user input when winform application running

I have a Crystal Reports to display invoice from a sale.我有一个 Crystal Reports 来显示销售发票。 I want to change the report header textbox manually.我想手动更改报告标题文本框。 Means, i have a form named as Crystal report settings.意思是,我有一个名为 Crystal 报表设置的表单。 I have a textbox in there to change report header.我在那里有一个文本框来更改报告标题。 I have a textbox object in crystal reports.我在水晶报表中有一个文本框对象。 When i add a value in textbox in crystal report settings form and clock on change it should change the value in textbox object in crystal report permanently.当我在水晶报表设置表单的文本框中添加一个值并更改时钟时,它应该永久更改水晶报表中文本框对象中的值。 I am using it to allow shops to change header details.我正在使用它来允许商店更改标题详细信息。 is there any way to achieve it?有什么办法可以实现吗? How can i permanently get values in textbox object of crystal report from user input?如何从用户输入中永久获取水晶报告文本框对象中的值?

Crystal Report Text Object is shown below Crystal Report 文本对象如下所示

水晶报表文本对象

From the textbox shows below i want to get values for textbox object in crystal reports从下面的文本框显示,我想获取水晶报表中文本框对象的值

在此处输入图片说明

I would suggest you to save your caption/Header of report within database and fetch from there, it will reduce the complexity.我建议您将您的标题/报告标题保存在数据库中并从那里获取,这将降低复杂性。 If you insist on using the form, then pass the changed caption/Header value to the form of crystal report through constructor or global variable approach.如果你坚持使用表单,那么通过构造函数或者全局变量的方式将改变后的caption/Header值传递给水晶报表的表单。 create a property within your change caption/header form, set its value and get it within your crystal report form and set it ie在更改标题/标题表单中创建一个属性,设置其值并在您的水晶报表中获取它并设置它,即

((TextObject)reportDocument.ReportDefinition.ReportObjects["Invoice_HeaderText"]).Text="Changed Header";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM