Using a Custom Field in XtraReports


Author
Message
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
OK I have added a dataset to my project which allows me to drag and drop fields to my reports but since this field is a custom field of one of my BO's it does not appear in the dataset. 

I added a calculated field to my report and set the following properties: Datasource = myDataSet, DataMember=myTableinDataSet and the Expression=[CustomFieldName]. Dropped it on the report.

Then in my code to run the report I do the following:
Dim ds As New DataSet
        ds.Tables.Add(Me.StockTempsBO1.CurrentDataTable)
        Dim ddate As Date
        ddate = Me.CalcDate.CurrentDate.ToLongDateString
Dim report As New StockthatFellThruReport
        report.XrLabelheading.Text = crodeoname
        report.XrLabelheading1.Text = "Stock That Fell Thru from Draw"
        report.XrLabelheading2.Text = cwhatevt
        report.XrLabelheading3.Text = ddate.ToString("D")
        report.DataSource = ds
        report.DataMember = Me.StockTempsBO1.TableName
        report.ShowPreview()
I am not sure it is sound code but it works great and does exactly what I want it too. Comments Welcome.



Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Glad you got it figured out...what was the issue (in case somebody else runs into a similar issue)?
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Never Mind I figured it out. 
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
I have a BO that has a custom field. That all works well but now I am trying to design a report using XtraReports from DevExpress and I want to use that custom field in the report. I don't know how to get the custom field on the report or how to make it show up on the report? 
I know this is not the DevExpress site but when I ask questions on their site they don't seem to understand BO's or I don't know how to ask the question there.
TIA.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search