posts - 61,  comments - 2033,  trackbacks - 0

/*
 * Created on 2005/12/12
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.foobar;


import java.awt.*;

import javax.swing.*;

import com.crystaldecisions.ReportViewer.*;
//import com.crystaldecisions.reports.sdk.*;
//import com.crystaldecisions.sdk.occa.report.reportsource.IReportSource;
import com.crystaldecisions.sdk.occa.report.application.*;
import com.crystaldecisions.sdk.occa.report.reportsource.*;

/**
 * @author phss
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class TestSwing {
 private static void createAndShowGUI(){
  try{
   JFrame.setDefaultLookAndFeelDecorated(false);
   JFrame frame = new JFrame("TestSwing");
   frame.setTitle("Testing CRX1...");
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   
   ReportViewerBean viewer = new ReportViewerBean();
   viewer.init(new String[0],null,null,null);
   System.err.println("--------------1----------");
   ReportClientDocument rpt = new ReportClientDocument();
   System.err.println("-------------2-----------");
   rpt.setReportAppServer("crmboe.mds-sn.com");
   //rpt.setReportAppServer("crmboe.ras.rptappserver");
   System.err.println("-------------3-----------");
   rpt.open("crmboe.ras.rptappserver://c:\\reports\\aa.rpt",0);
   //rpt.open("aa.rpt",0);
   System.err.println("--------------4----------");
   
   IReportSource rptSource = rpt.getReportSource();
   viewer.setReportSource(rptSource);
   System.err.println("--------------5----------");
   frame.getContentPane().add(viewer,BorderLayout.CENTER);
   frame.setSize(700,500);
   frame.setVisible(true);
   
   viewer.start();
   
   
  }catch(Exception e){
   e.printStackTrace();
  }
 }

 public static void main(String[] args) {
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      createAndShowGUI();
    }
  });
 }
}

posted on 2005-12-24 11:00 鱼上游 阅读(1110) 评论(0)  编辑  收藏 所属分类: 爪哇世界探险

只有注册用户登录后才能发表评论。


网站导航:
 
<2005年12月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

常用链接

留言簿(82)

随笔分类(59)

文章分类(21)

相册

收藏夹(40)

GoodSites

搜索

  •  

积分与排名

  • 积分 - 1265745
  • 排名 - 22

最新评论

阅读排行榜