开发者

JSP code to pass RecordSet in Crystal Report XI

开发者 https://www.devze.com 2023-03-07 04:00 出处:网络
I am new to JSP programming, and one of my client requirement is to use crystal report in JSP. I wan开发者_开发问答t to pass a recordset into the crystal report through jsp code.

I am new to JSP programming, and one of my client requirement is to use crystal report in JSP. I wan开发者_开发问答t to pass a recordset into the crystal report through jsp code. Any help would be highly appriciated.

Thanks, Yogi


I am able to solve this issue however when I pass resultset which has WHERER condition in sql statement or even resultset genereated from Stored Proc not data will be populated on the crystal report below is the code which I used to pass resultset in crystal report.

                       conn = ds.getConnection();
        Statement stmt = conn.createStatement();
        String query = "SELECT \"My1099_tbl1099M\".\"PAYERS_NAME_ADDR_1\", \"My1099_tbl1099M\".\"PAYERS_NAME_ADDR_2\", \"My1099_tbl1099M\".\"PAYERS_NAME_ADDR_3\", \"My1099_tbl1099M\".\"PAYERS_NAME_ADDR_4\", \"My1099_tbl1099M\".\"PAYERS_NAME_ADDR_5\" " +
        //     "FROM   \"AcctOps1099\".\"dbo\".\"My1099_tbl1099M\" ";



        resultSet = stmt.executeQuery(query);
        resultSet.next();
        String tableAlias = reportClientDocument.getDatabaseController().getDatabase().getTables().getTable(0).getAlias();

        //Push the Java ResultSet into the report.  This will then be the datasource of the report.
        reportClientDocument.getDatabaseController().setDataSource(resultSet, tableAlias , "My1099_tbl1099M1");

        reportSource = reportClientDocument.getReportSource();
0

精彩评论

暂无评论...
验证码 换一张
取 消