Possible BUG , Two DataSources

StarkStark Syria
edited February 2012 in FastReport .NET
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 :
    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

  • edited 10:10PM
    Hello,

    You register the same table twice with different names. This is not allowed.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.