Start Word in the client with JavaScript, and form a report to form a report.

xiaoxiao2021-03-06  73

Var title = Document.Forms [0] .title.value // Report the table title

IF (Title.Length <1)

{

Alert ("Report Data does not exist, please count")))

Return;

}

VAR Ksrq = Document.Forms [0] .bbksrq.value

VAR JSRQ = Document.Forms [0] .bbjsrq.value

Var Row_count = Document.Forms [0] .row_count.value

Var col_count = document.forms [0] .col_count.value

Var zd = Document.Forms [0] .zd.value

Var Context = Document.Forms [0] .context.Value

Var Temp

VAR i = 0, n = 0

Var vzd = new array ();

Var vcontext = new arch;

Var vcontext1 = new arch ();

VZD = zd.split ("//");

Var WordApp = New ActiveXObject ("Word.Application"); // Get Word object

Var WDCharacter = 1

Var wdorientLandscape = 1

Wordapp.Application.visible = true;

Var mydoc = wordapp.documents.add ();

Wordapp.activedocument.pagesetup.orientation = WDORIENTLANDSCAPE

WordApp. Selection.ParagraphFormat.Alignment = 0 // Central alignment

WordApp. Selection.font.bold = TRUE

WordApp. Selection.font.size = 20

WordApp. Selection.Typetext (" KSRQ " to " JSRQ ") ");

WordApp. Selection.Moveright (WDCharacter); // Nurse right shift character

Wordapp.seection.typeParagraph () // Insert paragraph

Wordapp.seection.typeParagraph () // Insert paragraph

Var myTable = mydoc.tables.add (Wordapp.Selection.Range, row_count, col_count) // Form 4 list

VAR TableRange; // The following is a cell in the form.

For (i = 0; i

{

With (MyTable.cell (1, i 1) .range)

{font.size = 12;

INSERTAFTER (VZD [I]);

}

}

For (i = 0; i

{

vContext = context.split ("")

For (n = 0; n

{

Temp = vcontext [i]

vContext1 = Temp.split ("")

With (MyTable.cell (i 2, n 1) .range) {font.size = 12;

INSERTAFTER (vcontext1 [n]);

}

}

}

Row_count = 0;

COL_COUNT = 0

MyDoc.protect (1)

转载请注明原文地址:https://www.9cbs.com/read-119635.html

New Post(0)