使用C#程序设置公式字段的左侧和顶部 [英] set left and top of formula field using C# program
本文介绍了使用C#程序设置公式字段的左侧和顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
我使用VS 2008,asp.net,c#.net。
我有一个网络应用程序使用水晶报告。
如何使用C#程序设置公式字段的左侧和顶部?
如何使用C#程序设置文本字段对象的左侧和顶部?
提前致谢
George nt
解决方案
打开水晶报表设计。权利点击公式字段你得到选项格式对象然后你可以调整它抛出这个!
如果没有得到那么再问一下!
章节;
FieldObject fieldObject1,fieldObject2,fieldObject3,fieldObject4;
// FieldFormat fieldFormat;
//按名称获取Section对象。
section = rptDoc.ReportDefinition.Sections [Section3];
//按名称获取ReportObject并将其转换为FieldObject。
//名称可以在属性窗口中找到。
fieldObject1 = section.ReportObjects [ChequeDate1]作为FieldObject;
fieldObject2 = section.ReportObjects [Party1] as FieldObject;
fieldObject3 = section.ReportObjects [RupeeToWrods1] as FieldObject;
fieldObject4 = section.ReportObjects [amount2] as FieldObject;
//检查FieldObject是否为空。
if(fieldObject1!= null)
{
//获取FieldFormat对象。
// fieldFormat = fieldObject.FieldFormat;
//fieldObject.Color = Color.Red;
fieldObject1.Left = Convert.ToInt32(rptDs.Tables [1] .Rows [0] [rfChequeDateLeft]);
fieldObject1.Top = Convert.ToInt32(rptDs.Tables [1]。行[0] [R fChequeDateTop]);
Hi friends,
I am using VS 2008,asp.net,c#.net.
I have a web application which uses crystal report.
How to set left and top of formula field using C# program ?
How to set left and top of Text field object using C# program ?
Thanks in advance
George n t
解决方案
Open your crystal reports design.Right click on formula field you get option format object then u can adjust it throw this!
if not got then again ask!
Section section;
FieldObject fieldObject1, fieldObject2, fieldObject3, fieldObject4;
//FieldFormat fieldFormat;
// Get the Section object by name.
section = rptDoc.ReportDefinition.Sections["Section3"];
// Get the ReportObject by name and cast it as a FieldObject.
// The name can be found in the properties window.
fieldObject1 = section.ReportObjects["ChequeDate1"] as FieldObject;
fieldObject2 = section.ReportObjects["Party1"] as FieldObject;
fieldObject3 = section.ReportObjects["RupeeToWrods1"] as FieldObject;
fieldObject4 = section.ReportObjects["amount2"] as FieldObject;
// Check if the FieldObject is null.
if (fieldObject1 != null)
{
// Get the FieldFormat object.
//fieldFormat = fieldObject.FieldFormat;
//fieldObject.Color = Color.Red;
fieldObject1.Left = Convert.ToInt32( rptDs.Tables[1].Rows[0]["rfChequeDateLeft"]);
fieldObject1.Top = Convert.ToInt32(rptDs.Tables[1].Rows[0]["rfChequeDateTop"]);
这篇关于使用C#程序设置公式字段的左侧和顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文