This is a migrated thread and some comments may be shown as answers.

Column 'xxx' does not belong to table MainTable.

3 Answers 278 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Leon
Top achievements
Rank 1
Leon asked on 20 May 2008, 03:26 AM
there are two problems I am heading with at moment

1. I have the following code in the report

Public Shared Function PrepareConatctRPT As DataTable  
 Dim ContactTbl As New DataTable  
 Dim aRow As DataRow = ContactTbl.NewRow  
 ContactTbl.Columns.Add("Buyer")  
 aRow.Item("Buyer") = true  
 ContactTbl.Rows.Add(aRow)  
End Function 
 
Private Sub ContactNormal_NeedDataSource(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.NeedDataSource  
        Me.DataSource = PrepareConatctRPT  
End Sub 
 
Private Sub detail_ItemDataBound(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles detail.ItemDataBound  
  Dim section As Processing.DetailSection = TryCast(sender, Processing.DetailSection)  
  Dim row As DataRowView = DirectCast(section.DataItem, DataRowView)  
  If CBool(row.Row("Buyer")) Then 
   'Do some code here  
  end if  
End Sub 

I have the following error message:

Column 'Buyer' does not belong to table MainTable.

if I have the same function setting datasource from other form, eg. aReport.datasouce=xxx
but not needdatasource (on demand)
it's functional

2. when I have printed using webarchive or word, the alignment is fine, however, when i print it to PDF, the alignment is slightly offset, do you have any idea what could cause it?

thanks and waiting for your reply :)

3 Answers, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 20 May 2008, 11:24 AM
Hello Leon,

About your first question.
In the handler of the NeedDataSource event you have to work (as in the ItemDataBound handler) with the processing items instead with the definition items.

Please review the help article Understanding Events for a detailed explanation how to handle events in Telerik Reporting.

In your case the code should look like:

Private Sub ContactNormal_NeedDataSource(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.NeedDataSource 
            Dim report as Telerik.Reporting.Processing.Report = DirectCast(sender, Telerik.Reporting.Processing.Report)
            report.DataSource = PrepareConatctRPT
End Sub


About your second question.
We need a little more information to be able to help you. Can you please send us the report source and the exported PDF file, or even better, send us a simple sample report, that reproduces the issue you are facing. Also please try to explain a little more detailed in what situation the displacement occurs.

Thank you for your cooperation.

Kind regards,
Milen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Leon
Top achievements
Rank 1
answered on 20 May 2008, 10:21 PM
the 1st question has been solved, thank you very much!
for the 2nd problem, i will send as much source as I could do, but which email address should i send it to?
0
Steve
Telerik team
answered on 23 May 2008, 11:59 AM
Hi Leon,

Please zip your report, open a support ticket and attach the archive there with reference to this forum thread. Once we review it we would be able to provide more info on the matter.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Leon
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
Leon
Top achievements
Rank 1
Steve
Telerik team
Share this question
or