on 09-05-2008 1:38 PM
Hi to all,
My task is during run time add a table to CR then add fieldobjects and
display in the crystal report viewer, all are working fine but problem is the fields are displaying
without heading, i want to add the heading for every column in detail section.
This is my sample code
boFieldObject2 = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
boFieldObject.DataSourceName = "{User_Images.imgId}";
boFieldObject.DataSource = "{User_Images.imgId}";
boFieldObject.Name = "imgId";
boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeInt32sField;
boFieldObject.Left = 4 * 1440; //1440 twips per inch
boFieldObject.Width = 3 * 1440;
boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
boFieldObject.FontColor.Font.Name = "Arial";
boFieldObject.FontColor.Font.Size = 10;
//Add the object to the report
boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
There is FieldHeadingObject i tried but unable to set the Text.
I'm using Crystal Report 11.5,Visual Studio2005-C#,Asp.net 2.0 and SQL Server.
Experts please help me.
The only way to directly add both the database field and the header at the same time, does not allow you to have full control of formatting of both parts being added. I would suggest adding additional code to add the headers you want as text objects to the page header section. See the sample for adding text objects in your other [post|;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.