A
download demo.html
Language: NonCode
LOC: 0
Project Info
JCom (Java-COM Bridge)(jcom)
Server: SourceForge
Type: cvs
...e\j\jcom\jcom\jcom\docs\jp\
   demo.html
   faq.html
   guide.html
   index.html
   manga_page1.html
   manga_page2.html
   manga_page3.html
   manga_page4.html
   next.html

<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<META NAME="KEYWORDS" CONTENT="Java,Com,Bridge,GNU,LGPL,JNI,Microsoft,component,object,model,Excel,Windows,XML">
<META NAME="description" CONTENT="This is a software project web page for Java-COM Bridge library called JCom. This software enable Java to access COM Objects such as Excel or Word.">
<title>�v���O���}�['s������/JCom(Java-COMu���bW)</title>
</head>

<body text="#000000" bgcolor="#FFFFFF">

<center><h2><font color="brown">JCom(Java-COMu���bW)</font></h2></center>
<center><img src="../images/jcom.jpg"></center>
<BR>
<hr><!------------------------------------------------------------------->
<H3>�T���v���PF��{�I�Ȏg����</H3>
(jcom)/demo/samples/testExcel.java<BR>
<PRE>
import <font color="blue"><B>jp.ne.so_net.ga2.no_ji.jcom.excel8.*</B></font>;
import <font color="blue"><B>jp.ne.so_net.ga2.no_ji.jcom.*</B></font>;
import java.io.File;
import java.util.Date;

/* Excelp���bp��gB��AJCom�̃T���v���v���O���� */
class testExcel {
    public static void main(String[] args) throws Exception {
        <font color="blue"><B>ReleaseManager</B></font> rm = new <font color="blue"><B>ReleaseManager();</B></font>
        try {
            System.out.println("EXCEL��N����...");
            // ���łɗ����オ����ƁA�V�����EB���hE�ŊJ���B
            <font color="blue"><B>ExcelApplication</B></font> excel = new <font color="blue"><B>ExcelApplication</B></font>(rm);
            excel.Visible(true);
            // �F��ȏ���\��
            System.out.println("Version="+excel.<font color="blue"><B>Version()</B></font>);
            System.out.println("UserName="+excel.<font color="blue"><B>UserName()</B></font>);
            System.out.println("Caption="+excel.<font color="blue"><B>Caption()</B></font>);
            System.out.println("Value="+excel.<font color="blue"><B>Value()</B></font>);

            <font color="blue"><B>ExcelWorkbooks</B></font> xlBooks = excel.<font color="blue"><B>Workbooks()</B></font>;
            <font color="blue"><B>ExcelWorkbook</B></font> xlBook = xlBooks.<font color="blue"><B>Add</B></font>();   // �V�����ubN��쐬
            
            // ���ׂẴt�@�C����񋓂��Ă݂�
            System.out.println("���݂̃f�B���N�g���̃t�@�C����Z���ɐݒ�");
            <font color="blue"><B>ExcelWorksheets</B></font> xlSheets = xlBook.<font color="blue"><B>Worksheets</B></font>();
            <font color="blue"><B>ExcelWorksheet</B></font> xlSheet = xlSheets.<font color="blue"><B>Item</B></font>(1);
            <font color="blue"><B>ExcelRange</B></font> xlRange = xlSheet.<font color="blue"><B>Cells</B></font>();

            xlRange.<font color="blue"><B>Item(1,1).Value</B></font>("�t�@�C����" );
            xlRange.<font color="blue"><B>Item(2,1).Value</B></font>("�T�C�Y" );
            xlRange.<font color="blue"><B>Item(3,1).Value</B></font>("�ŏI�X�V��");
            xlRange.<font color="blue"><B>Item(4,1).Value</B></font>("�f�B���N�g��");
            xlRange.<font color="blue"><B>Item(5,1).Value</B></font>("�t�@�C��");
            xlRange.<font color="blue"><B>Item(6,1).Value</B></font>("�ǂݍ��݉�");
            xlRange.<font color="blue"><B>Item(7,1).Value</B></font>("�������݉�");

            File path = new File("./");
            String[] filenames = path.list();
            for(int i=0; i&lt;filenames.length; i++) {
                File file = new File(filenames[i]);
                System.out.println(file);
                xlRange.<font color="blue"><B>Item(1,i+2).Value</B></font>( file.getName() );                // �t�@�C�����pX����
                xlRange.<font color="blue"><B>Item(2,i+2).Value</B></font>( (int)file.length() );            // �t�@�C���TCY
                xlRange.<font color="blue"><B>Item(3,i+2).Value</B></font>( new Date(file.lastModified()) ); // �ŏI�XV��
                xlRange.<font color="blue"><B>Item(4,i+2).Value</B></font>( file.isDirectory()?"Yes":"No" ); // �fB���Ng�����H
                xlRange.<font color="blue"><B>Item(5,i+2).Value</B></font>( file.isFile()?"Yes":"No" );      // �t�@�C�����H
                xlRange.<font color="blue"><B>Item(6,i+2).Value</B></font>( file.canRead()?"Yes":"No" );     // �ǂݎ��‚��H
                xlRange.<font color="blue"><B>Item(7,i+2).Value</B></font>( file.canWrite()?"Yes":"No" );    // �������݉‚��H
            }
            String expression = "=Sum(B2:B"+(filenames.length+1)+")";
            System.out.println("�����𖄂ߍ��݁A�t�@�C���T�C�Y�̍��v�끂߂� "+expression);
            xlRange.<font color="blue"><B>Item(1,filenames.length+2).Value</B></font>("���v");
            xlRange.<font color="blue"><B>Item(2,filenames.length+2).Formula</B></font>(expression);
            xlRange.<font color="blue"><B>Columns().AutoFit</B></font>();    // ������tBbg������

            // �v�����^�ɏo�͂���ꍇ�̓R�����g��͂����Ă��������B
            // �ftH���g�̃v�����^�ɏo�͂���܂��B
//          System.out.println("�v�����^�Ɉ��܂��B");
//          xlSheet.<font color="blue"><B>PrintOut</B></font>();

            // �t�@�C���ɕۑ�����ꍇ�̓R�����g��O���Ă��������B
            // �fB���Ng����w�肵�Ȃ��ꍇ�́A(My Documents)�ɕۑ�����܂��B
//          System.out.println("�t�@�C���ɕۑ����܂��B(My Documents)\\testExcel.xls");
//          xlBook.<font color="blue"><B>SaveAs</B></font>("testExcel.xls");

            xlBook.<font color="blue"><B>Close</B></font>(false,null,false);
            excel.<font color="blue"><B>Quit</B></font>();

            System.out.println("���Ò��A���肪�Ƃ��������܂����B");
        }
        catch(Exception e) { e.printStackTrace(); }
        finally { rm.<font color="blue"><B>release</B></font>(); }
    }
}
</PRE>
<BR>

<hr><!------------------------------------------------------------------->
<H3>�T���v���QFExcel��g��Ϗ���쐬</H3>
(jcom)/demo/estimate/<BR>
<BR>
���錩�Ϗ����I�ɍ��VXe��������Ɖ��肵�܂��BVXe�����̂͂i�������őg��ł��܂����A���Ϗ��̕���������
�d���������ō��Kv������Ƃ��܂��Bd���������̕�i���̍���
�V�[�g�����܂����A����͂d���������̈��@�\�ט�p���܂��B<BR>
<BR>
�܂��Aestimate.xls�쩂Ă��������B
����͌��Ϗ��̌����ɂ�����܂��BKv�Ȑ����ք�ߍ��܂�Ă��܂����A���͈͂�ݒ�ς݂ł��B

���̃t�@�C���⢂B���ʂ̖��O�ŃR�s�[���A����ɑ΂��ĕK�v��
�ӏ��ɒl����Ă����܂��B
�����Ĉ��A�ۑ����ďI�����܂��B<BR>
<BR>
�Rs�[���ꂽ�t�@�C���́A���ׂĎc���Ă�����̂Ƃ��܂��B
�������Băt�@�C�����̓��j�[�N�Ȓl�ɂ��܂��B
����́A���Ϗ�No�ƈ�v�������悢�ł��傤�B 
�����͌��ϗL���Ԃ��߂���܂ŕێ����܂��B
�������A���̃T���v���ł͂����܂Ŏ����Ă��܂���B<br>
<BR>
�T���v���ł͎
ۂɂ͈��܂��񂪁A�ȉ��̍s��R�����g����O���Έ���s���܂��B
<PRE>    // est.print_enable = true;</PRE>
�
ۂ̉^�p�ƂȂ�ƁA�v�����^�̑���ɂe�`�w�⃁�[���ɑ��邱�Ƃ�
�l�����܂��ˁB<BR>
���̃T���v����JCom Ver2.01�ȍ~�̃t�@�C���Ɋ܂܂�Ă��܂��B
Excel97,2000�œ��삵�܂��B
<BR>
<hr><!------------------------------------------------------------------->
<H3>�T���v���RFExcelt�@�C������wlk��쐬</H3>
(jcom)/demo/outxml/<BR>
�T���v���Q�ō쐬���ꂽ�����‚��̌��Ϗ�����AKv�ȃf�[�^��
���o���Ăw�lk�ɏo�͂��܂��B
�܂��AJ�����gfB���Ng���ɂ���Excelt�@�C����J���Az�莖��Ƃ͋t�̕�@�ŁA�Y���Z������f�[�^��擾���܂��B
���Ƃ́APrintWriter��gBXMLt�@�C������܂��B<BR>
<BR>
���̃T���v���ł�XML�̏o�݂͂̂Ȃ̂ŁAXML�p�[�T�͕Kv
����܂���B �������AXMLp�[�T������΁AXML��EXCEL��
������”\�ł��傤�B<BR>
<BR>
���
s��@<BR>
���炩���߁A�ib�������������C���Xg�[�����Ă����̂Ƃ��܂��B<BR>
<UL><PRE>
javac OutXML.java        //�R���pC����@
java OutXML              // �
s��@                
</PRE></UL>
<hr><!------------------------------------------------------------------->
<H3>�T���v���SFVB�ō쐬�����bnl�𗘗p����B</H3>
(jcom)/demo/vbcom/<BR>
<img class="inline" src="http://sourceforge.net/sflogo.php?group_id=91654&type=1&sf.gif" alt="http://sourceforge.net/sflogo.php?group_id=12841&type=1" />

</body>
</html>

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us