Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Changing DataSet for a library component
griniland
<p>I have a grid component in rptlibrary. It is connected to library test DataSet ("TestDS")</p><p> </p><p>All fields binding information is valid.</p><p> </p><p>Then I go to my report and try to use this library grid, insert it to my design, thats ok.</p><p>Try to preview - ok, I see test data retrieved from TestDS dataSet.</p><p> </p><p>Then - try to bind it to my actual DataSet "ThisDS" through property editor, advanced section - type in "ThisDS" into Data Set field. Fine, no errors.</p><p>Try to preview - get multi "Invalid bound column name" errors - one for each column in my grid.</p><p>What's wrong? TestDS and ThisDS have identical field structure and query, but different DataSources (2 different XML files of the same format and structure).</p><p>Same problem occurs, when changing dataSet through script, for example, in initialize event.</p><pre class="_prettyXprint">reportContext.getDesignHandle().findElement("MyGrid").setProperty("dataSet","ThisDS") </pre><p>.</p><p> </p><p>Where binding column information is corrupted and how to restore it, m.b. through scripting?</p><p> </p>
Find more posts tagged with
Comments
micajblock
<p>try using a table not a grid.</p>
griniland
<p>Tried. All the same. And yes, if I change DataSet through designer (not "advanced tab") - all works, but not fine - binding information is included in my report design file (I checked source XML file). I don't want it at all - I need to save it in rptlibrary only to maintain furhter possible changes in library, not in all children nodes! </p>
micajblock
<p>What are you trying to accomplish?</p>
griniland
<p>I try to use one form (Grid or Table, nevermind) from rptlibrary with defined (to test DataSet) binding information in several dozen of reports with real DataSets (all of them have same fields that rptlibrary dataSet does) defined in these reports. Without having binding information explicitly moved to these reports, I need it to be inherited from rptlibrary.</p><p>Is it possible ?</p>
micajblock
<p>Maybe, IF it i possible I think you need to put the code in the beforeFactory. What is the difference between the test data set (in the library) and the real data set (in the report)?</p><p>Why not just reuse the data set also?</p>
griniland
<p>First of all, thanks for reply!</p><p> </p><p>Even if "initialize" script fails - beforeFactory will not help, I tried. The reason lies somewhere I can't catch the sense... It's all about those **** libraries.</p><p>No differences, except DataSource. Different XML files. Even worse, there are no files - our reports use oda.xml.FileInputStream from Context.</p>
micajblock
<p>Will dynamically changing the XML file name work? Put that code in the library and it should work.</p>
griniland
<p>There is no file, actually. It's InputStream object, that's solution doesn't suite.</p><p>Simple way, how I see it - change one paremeter, DataSet name.. I don't even understand, what goes wrong.</p>
micajblock
<p>I would have to investigate, and right now I do not have time. Maybe someone else will chime in.</p>