Possible BUG , Two DataSources
Stark
Syria
Hi , have a good day ,
Quick Info :
Download the Example , and press the Preview Button from Report Designer "Twice" ,
The Report Will not Filter the Data at the Second preview
www.smart-arab.com/datascript.zip
www.smart-arab.com/exa.zip
www.smart-arab.com/report.zip
End of Quick Info
Explain : ( Optional )
I Have two SQL Tables , BillHeader and BillBody and I want to:
- Show BillHeader.Notes on my Report PageFooter.
- Show BillBody.Material, BillBody.Qty on my report Data Section.
So I Did the following :
- Joined the two tables with SQL Query , And Fill DataTable "tbBills" with it.
- Add to my report file Two Data Sources.
- Register The Two Report Data Sources with "tbBills" DataTable.
As In The Following Code :
The Only Problem is when you press the preview button on Report Designer , it's stop Filter the data on the second preview ,
SQL Tables Structur And Data :
Thank you in Advance
Quick Info :
Download the Example , and press the Preview Button from Report Designer "Twice" ,
The Report Will not Filter the Data at the Second preview
www.smart-arab.com/datascript.zip
www.smart-arab.com/exa.zip
www.smart-arab.com/report.zip
End of Quick Info
Explain : ( Optional )
I Have two SQL Tables , BillHeader and BillBody and I want to:
- Show BillHeader.Notes on my Report PageFooter.
- Show BillBody.Material, BillBody.Qty on my report Data Section.
So I Did the following :
- Joined the two tables with SQL Query , And Fill DataTable "tbBills" with it.
- Add to my report file Two Data Sources.
- Register The Two Report Data Sources with "tbBills" DataTable.
As In The Following Code :
    DataTable tbBills = new DataTable();
    //Select The Orders Of City Only by adding "WHERE Billheader.notes = 'City Order'" at the end of Query
    DBConnect.DBCommand = new OleDbCommand("SELECT * FROM BillHeader JOIN BillBody ON BillHeader.guid = BillBody.parentguid WHERE Billheader.notes = 'City Order'", DBConnect.DBConnection);
    DBConnect.DBAdapter = new OleDbDataAdapter(DBConnect.DBCommand);
    DBConnect.DBAdapter.Fill(tbBills);
    FastReport.Report report = new FastReport.Report();
    report.Load("C:\\report.frx");
    report.RegisterData(tbBills, "BillHeader");
    report.RegisterData(tbBills, "BillBody");
    report.Design();
So Far So good ,The Only Problem is when you press the preview button on Report Designer , it's stop Filter the data on the second preview ,
SQL Tables Structur And Data :
CREATE Table BillHeader (
GUID uniqueidentifier NULl ,
Number INT null ,
Notes Varchar (50) NULL
)
CREATE Table BillBody (
GUID uniqueidentifier NULl ,
ParentGuid uniqueidentifier null ,
Material Varchar (50) NULL ,
Qty float  NULL
)
Thank you in Advance
Comments
You register the same table twice with different names. This is not allowed.