免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2353 | 回复: 2
打印 上一主题 下一主题

eclipse3.2 + crystal [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-10-10 18:09 |只看该作者 |倒序浏览

我现在用的是eclipse3.2自带的crystal来做水晶报表, 现在简单数据报表都已完成.
想请教下在:
[color=Red]1.[/color] 我可否设置每页显示记录的条数, 怎么设置
[color=Red]2.[/color] 不知哪位是否有连接oracle的方法, 在下载的例子中,
        private static void switch_tables(DatabaseController databaseController) throws ReportSDKException {

                //Declare the new connection properties that report's datasource will be switched to.
                //NOTE: These are specific to using JDBC against a particular MS SQL Server database.  Be sure to use the
                //DisplayConnectionInfo sample to determine what your own connection properties need to be set to.
                final String TABLE_NAME_QUALIFIER = "xtreme.dbo.";
                final String DBUSERNAME = "devtech";
                final String DBPASSWORD = "devtech";
                final String SERVERNAME = "vancsdb02.crystald.net";
                final String CONNECTION_STRING = "Use JDBC=b(true);Connection URL=s(jdbc:microsoft:sqlserver://vancsdb02.crystald.net:1433);" +
                                                                                 "Database Class Name=s(com.microsoft.jdbc.sqlserver.SQLServerDriver);Server=s(vancsdb02.crystald.net);" +
                                                                                 "User ID=s(vantech);Password=;Database=s(Xtreme1);Trusted_Connection=b(false);" +
                                                                                 "JDBC Connection String=s(!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://vancsdb02.crystald.net:1433;" +
                                                                                 "DatabaseName={database};user={userid};password={password}!)";
                final String DATABASE_NAME = "Xtreme";
                final String URI = "!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:microsoft:sqlserver://vancsdb02.crystald.net:1433;DatabaseName={database};user={userid};password={password}!";
                final String DATABASE_DLL = "crdb_jdbc.dll";
               
                //Obtain collection of tables from this database controller.
                Tables tables = databaseController.getDatabase().getTables();

                //Set the datasource for all main report tables.
                for (int i = 0; i < tables.size(); i++) {

                        ITable table = tables.getTable(i);

                        //Keep existing name and alias.
                        table.setName(table.getName());
                        table.setAlias(table.getAlias());
                                                       
                        //Change properties that are different from the original datasource.
                        table.setQualifiedName(TABLE_NAME_QUALIFIER + table.getName());
                       
                        //Change connection information properties.
                        IConnectionInfo connectionInfo = table.getConnectionInfo();
                                                       
                        //Set new table connection property attributes.
                        PropertyBag propertyBag = new PropertyBag();
                       
                        //Overwrite any existing properties with updated values.
                        propertyBag.put("Trusted_Connection", "false");
                        propertyBag.put("Server Name", SERVERNAME); //Optional property.
                        propertyBag.put("Connection String", CONNECTION_STRING);
                        propertyBag.put("Database Name", DATABASE_NAME);
                        propertyBag.put("Server Type", "JDBC (JNDI)");
                        propertyBag.put("URI", URI);
                        propertyBag.put("Use JDBC", "true");
                        propertyBag.put("Database DLL", DATABASE_DLL);
                                       
                        connectionInfo.setAttributes(propertyBag);
                       
                        //Set database username and password.
                        //NOTE: Even if these the username and password properties don't change when switching databases, the
                        //database password is *not* saved in the report and must be set at runtime if the database is secured.  
                        connectionInfo.setUserName(DBUSERNAME);
                        connectionInfo.setPassword(DBPASSWORD);
                        connectionInfo.setKind(ConnectionInfoKind.SQL);
                                                       
                        table.setConnectionInfo(connectionInfo);
                       
                        //Update old table in the report with the new table.
                        databaseController.setTableLocation(table, tables.getTable(i));
                       
                }
                               
        }
我修改后, 老是报错.
我现在的查数据部分都是在rpt里面实现的.

论坛徽章:
0
2 [报告]
发表于 2006-10-10 18:55 |只看该作者
数据库的连接已经解决.  

记录的条数, 或者左边的树状菜单不知道怎么用参数设置.......

论坛徽章:
0
3 [报告]
发表于 2006-10-13 15:44 |只看该作者
各位帮留个言啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP