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)
add dyanamic columns in dataset depending upon parameters values
rekha1989
Hi all,
I wanted to add the dyanamic columns in dataset of a report depending upon the parameters send by user.
how should i do it i try the following senirio but it doesn't work.
DataSetHandle dsh = designHandle.findDataSet("xyz");
OdaResultSetColumn dataSetColumn =StructureFactory.createOdaResultSetColumn();
dataSetColumn.setColumnName("");
dataSetColumn.setDataType(DesignChoiceConstants.PARAM_TYPE_STRING);
dataSetColumn.setNativeDataType(12);
dataSetColumn.setPosition(0);
dataSetColumn.setNativeName("");
PropertyHandle odaDataSetParameterProp = dsh.getPropertyHandle(DataSetHandle.RESULT_SET_PROP);
odaDataSetParameterProp.addItem(dataSetColumn);
Kindly provide the solution if u have.
Thanks
Find more posts tagged with
Comments
akk2
Hi, it's a bit complex at first... See here for an example:
http://wiki.eclipse.org/Java_-_Execute_Modified_Report_(BIRT)
You just have to populate the fields using your param values.
The only thing lacking seems to be the columnHints, as if you modify a report doing the same as the above example, the Birt Designer shows errors if you try to edit the dataset, which I believe comes from lack of columnHints...
Good luck!
rekha1989
<blockquote class='ipsBlockquote' data-author="'akk2'" data-cid="79832" data-time="1310147904" data-date="08 July 2011 - 10:58 AM"><p>
Hi, it's a bit complex at first... See here for an example: <a class='bbc_url' href='
http://wiki.eclipse.org/Java_-_Execute_Modified_Report_(BIRT)'>http://wiki.eclipse.org/Java_-_Execute_Modified_Report_(BIRT)</a>
; You just have to populate the fields using your param values.<br />
<br />
The only thing lacking seems to be the columnHints, as if you modify a report doing the same as the above example, the Birt Designer shows errors if you try to edit the dataset, which I believe comes from lack of columnHints...<br />
<br />
Good luck!<br /></p></blockquote>
<br />
Thanks for reply akk2,<br />
but i already gothrough the example provide by u.The requirement of me and solution provide by u is diff.I wanted to add dyanamic columns in the dataset.<br />
For example if my query retains only 3 columns then only three columns get added in dataset not more than that.<br />
The no of columns retain by query is different.
arunkumarb
HI,CAN U RECREATE UR REPORT WITH SAMPLE DATABASE SO THAT I CAN RUN UR REPORT AND I WILL CHECK IT ONCE,
REGARDS,
ARUN
Sunil1
Better u create store procedure as per following example for oracle 10g
create or replace PROCEDURE ****_TAXBASE
( roleid IN NUMBER,
reportmonth IN NUMBER,
reportyear IN NUMBER,
result OUT SYS_REFCURSOR
) AS
BEGIN
OPEN result FOR SELECT * FROM
CAP2_ASSMNT_TAXBASE_MNTLY_RPT,cap2_assmnt_returns
where
CAP2_ASSMNT_TAXBASE_MNTLY_RPT.ROLE_ID = roleid and
CAP2_ASSMNT_TAXBASE_MNTLY_RPT.REPORT_MONTH = reportmonth and
CAP2_ASSMNT_TAXBASE_MNTLY_RPT.REPORT_YEAR = reportyear and
CAP2_ASSMNT_TAXBASE_MNTLY_RPT.ROLE_ID = cap2_assmnt_returns.ROLE_ID and
CAP2_ASSMNT_TAXBASE_MNTLY_RPT.REPORT_MONTH = cap2_assmnt_returns.REPORT_MONTH and
CAP2_ASSMNT_TAXBASE_MNTLY_RPT.REPORT_YEAR = cap2_assmnt_returns.REPORT_YEAR ;
END ****_TAXBASE;
Than call this procedure with parameter dynamically.
e.g.
call ****_TAXBASE {(?,?,?,?)}
Create four report parameter(variables) for this example in your report.
mark than as "is required"
when you run the report birt-viwer will ask u to enter parameter,
as u enter parameter report will call procedure and generate report.
rekha1989
Thanks for reply..........................
datakeywor
Hi,<br />
I had solved the same problem.<br />
To prepare for complex data, the esProc utility, built with Java and offered for free.<br />
Check <a class='bbc_url' href='
http://www.esproc.com/library/product/invoking-by-report-tool-via-jdbc.html'>esProc
Invoked by Report Tool via JDBC</a> for details about how to add dynamic data in dataset.