Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312705

Summary: Using DataSource From a Library
Product: z_Archived Reporter: Scott Rosenbaum <scottr>
Component: BIRTAssignee: Birt-ReportDesigner <Birt-ReportDesigner-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P2 CC: rlu, zqian
Version: 2.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Scott Rosenbaum CLA 2010-05-12 16:07:43 EDT
If you are using a DataSource from a library, and you modify the report design or change the name of the report design, it appears that the DataSource id, gets reset to a new number.  

When this happens, the DataSource is not longer visible within the design. The issue can be resolved by manually editing the XML file and returning the id back to its original number (pre-file save).

To re-create.  Make a file and reference a flat file data source from a rptlibrary.  Add a Dataset and a table.  All should be working just fine.

Open the XML and make note of the id for the DataSet.

Then copy the file to a new file name.  Open the copied file and you will see the DataSource is not available (all properties default to null).  Change the id to some other number (choose a large number).  This will probably fix the problem.

Then manually re-assign the id back to its original value.  This should also work.

This one is truly a strange one.

Also note, I have modified my RESOURCE_HOME to be Workspace root.
Comment 1 Rick Lu CLA 2010-05-12 22:05:46 EDT
Can you please attach the report design file that is corrupted? How did you copy the file? Is that by choosing the file and copy/paste in the eclipse navigator view?
Comment 2 Scott Rosenbaum CLA 2010-05-12 22:10:59 EDT
Rick, should be easier for you to set up on your own.  Seems to be more tied to the use of {workspace_loc} under windows=>Preferences=>Report Design=>Resource Home.

Just change your resource home, create a separate project, put in the DataSource and the in a different project create a report that references the DataSource.

Close the report, and open sometimes I have seen the issue only doing this.
If that doesn't do it, just do a drag ctrl drop in the Navigator and you will see it.
Comment 3 Rick Lu CLA 2010-05-12 22:29:57 EDT
(In reply to comment #2)
> 
> Just change your resource home, create a separate project, put in the
> DataSource and the in a different project create a report that references the
> DataSource.
> 
> Close the report, and open sometimes I have seen the issue only doing this.
> If that doesn't do it, just do a drag ctrl drop in the Navigator and you will
> see it.

Little confused... The library is not in the resource folder? Let's say we have a rptdesign and rptlibrary. The rptlibrary has a data source. The rptdesign uses the rptlibrary.

1. rptlibrary in a project test1 (not in the resource home?)
2. rptdesign in another project test2?

For a rptdesign to use a library, the library should be either in the resource home or same folder as the rptdesign.
Comment 4 Scott Rosenbaum CLA 2010-05-12 22:43:04 EDT
Two projects:

common_project
  - common.rptlibrary

reports_project
  - some_design_file.rptdesign


Both projects sit at Workspace_home.  

So you modify the location of RESOURCE_HOME to be the workspace location (do this using the variables tab).  Then when you add the element you will navigate through the project, to the file and the element in the file.  

In your XML you will see the the rptlibrary references as:

common_project/common.rptlibrary


So the rptlibrary is in the Resource folder, it is just in a different project and all of the projects are on the same relative path. 

This is a fairly common configuration when doing large scale development.
Comment 5 Zhiqiang Qian CLA 2010-05-12 23:26:42 EDT
This may be a duplicate of bug 291558, please try latest 2.6 build.

*** This bug has been marked as a duplicate of bug 291558 ***