Форум программистов, компьютерный форум, киберфорум
Visual Basic .NET
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.50/4: Рейтинг темы: голосов - 4, средняя оценка - 4.50
32 / 4 / 0
Регистрация: 23.11.2016
Сообщений: 39

Проскакивает отображение страницы в WebBrowser

14.10.2019, 21:52. Показов 893. Ответов 5
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Добрый день форумчане!

Добавлено через 10 минут
Блин какой-то глюк текст уже третий раз набираю

Есть форма на ней есть кнопка и WebBrowser

при нажатии на кнопку формируется выписка и показывается пользователю, но так как некоторые выписки могут формироваться достаточно долго, хотел в начале показать страницу ожидания, мол прога не зависла а формирует выписку.
Но при нажатии на кнопку происходит блокировка формы и в итоге после ожидания показывается уже выписка.

VB.NET
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
  Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles ToolStripButton3.Click
        Dim BodyHtml As String = "<!DOCTYPE html>
<html lang='ru' >
<head>
    <meta charset='utf-8' />
<title></title>
        <style>
body{
background-color:#F8F8FF
}
</style>
</head>
<body>
<div align='center'><H3> Подождите идет формирование выписки банка!  </H3></div>
<div align='center'>  <img src='" & Application.StartupPath & "\img\LoadGif.gif'" & " width='240' height='200' alt='LoadGif'>
</div>
</body>
</html>
"
      'здесь показываю страницу ожидания
        WebBrowser1.Document.OpenNew(False)
        WebBrowser1.Document.Write(BodyHtml)
        WebBrowser1.Refresh()
 
      'здесь начинаю формировать выписку
        If ComboBox1.SelectedValue <> 0 Then
            Dim SqlRsh As String = " AND IDAccountOrganizer=" & ComboBox1.SelectedValue
            ' сальдо на начало
            Dim SaldoNach As Decimal = getDec("SELECT((SELECT SUM(AmountOrder) As Postupl FROM paymentorder 
WHERE IDDirectionOrder=1 AND DatePaymentOrder<'" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "'" & SqlRsh &
")-(SELECT SUM(AmountOrder) As Spisan FROM paymentorder WHERE IDDirectionOrder=2 AND 
DatePaymentOrder<'" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "'" & SqlRsh & ")) AS SaldoNach FROM paymentorder")
            ' Обороты за период
            Dim debet As Decimal = getDec("SELECT SUM(AmountOrder) As Postupl FROM paymentorder WHERE IDDirectionOrder=1 AND DatePaymentOrder>='" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(DateTimePicker2.Value, "yyyy-MM-dd") & "' " & SqlRsh)
            Dim Kredit As Decimal = getDec("SELECT SUM(AmountOrder) As Postupl FROM paymentorder WHERE IDDirectionOrder=2 AND DatePaymentOrder>='" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(DateTimePicker2.Value, "yyyy-MM-dd") & "' " & SqlRsh)
            ' Сальдо на конец периода
            Dim SaldoCon As Decimal = SaldoNach - Kredit + debet
 
            Dim PrevDate As String = getScalar("SELECT MAX(DatePaymentOrder) FROM paymentorder WHERE DatePaymentOrder<'" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' " & SqlRsh)
            'документы оборота за период
            Dim DocObr As DataTable = getDataTable("SELECT * FROM paymentorder WHERE DatePaymentOrder>='" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(DateTimePicker2.Value, "yyyy-MM-dd") & "' " & SqlRsh, "DocObr")
            Dim tr As String = ""
            If DocObr.Rows.Count = 0 Then
                tr = "<tr height=51 style='height:38.25pt'>
  <td height=51 class=xl70 style='height:38.25pt;border-top:none'></td>
  <td class=xl71 style='border-top:none;border-left:none'></td>
  <td class=xl72 style='border-top:none;border-left:none'></td>
  <td class=xl65 align=right style='border-top:none;border-left:none'></td>
  <td class=xl65 align=right style='border-top:none;border-left:none'></td>
  <td class=xl73 width=141 style='border-top:none;border-left:none;width:106pt'><br>
    <br>
    </td>
  <td class=xl69 style='border-top:none;border-left:none'></td>
 </tr>"
            End If
 
            For i As Integer = 0 To DocObr.Rows.Count - 1
                'распределяем сумму по дебету кредету
                Dim dbt As String = ""
                Dim kred As String = ""
                If DocObr(i)("IDDirectionOrder") = 1 Then
                    kred = Format(DocObr(i)("AmountOrder"), "#,##0.00")
                Else
                    dbt = Format(DocObr(i)("AmountOrder"), "#,##0.00")
                End If
                ' получаем данные по контрагенту
                Dim dtContr As DataTable = getDataTable("SELECT NameContractor, INNContractor, 
(SELECT Rsch FROM accountcontractors WHERE IDAccountContractor=" & DocObr(i)("IDAccountContr") & ") As AccauntContr 
FROM `contractors` WHERE IDContractor=" & DocObr(i)("IDContr"), "dtContr")
                Dim cont As String = "ИНН " & dtContr(0)("INNContractor") & "<br>" & "Р/сч.№ " & dtContr(0)("AccauntContr") & "<br>" & dtContr(0)("NameContractor")
 
                tr = tr & "<tr height=51 style='height:38.25pt'>
  <td height=51 class=xl70 style='height:38.25pt;border-top:none'>" & DocObr(i)("NumberPaymentOrder") & "</td>
  <td class=xl71 style='border-top:none;border-left:none'>" & DocObr(i)("Wagetype") & "</td>
  <td class=xl72 style='border-top:none;border-left:none'>" & DocObr(i)("DatePaymentOrder") & "</td>
  <td class=xl65 align=right style='border-top:none;border-left:none'>" & dbt & "</td>
  <td class=xl65 align=right style='border-top:none;border-left:none'>" & kred & "</td>
  <td class=xl73 width=141 style='border-top:none;border-left:none;width:106pt'>" & cont & "</td>
  <td class=xl69 style='border-top:none;border-left:none'>" & DocObr(i)("PurposePayment") & "</td>
 </tr>"
            Next
 
 
            BodyHtml = "
<html xmlns:v=""urn:schemas-Microsoft - com: vml""
xmlns:o=""urn: schemas-Microsoft - com: office : office""
xmlns:x=""urn: schemas-Microsoft - com: office : excel""
xmlns=""http://www.w3.org/TR/REC-html40"">
 
<head>
<meta http-equiv=Content-Type content=""text/html; charset=windows-1251"">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content=""Microsoft Excel 12"">
<style>
<!--table
    {mso-displayed-decimal-separator:"" \,"";
    mso-displayed-thousand-separator:"" "";}
@page
    {margin:.75in .7in .75in .7in;
    mso-header-margin:.3in;
    mso-footer-margin:.3in;}
 
tr
    {mso-height-source:auto;}
col
    {mso-width-source:auto;}
br
    {mso-data-placement:same-cell;}
.style0
    {mso-number-format:General;
    text-align:general;
    vertical-align:bottom;
    white-space:nowrap;
    mso-rotate:0;
    mso-background-source:auto;
    mso-pattern:auto;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:Calibri, sans-serif;
    mso-font-charset:204;
    border:none;
    mso-protection:locked visible;
    mso-style-name:Обычный;
    mso-style-id:0;}
td
    {mso-style-parent:style0;
    padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:Calibri, sans-serif;
    mso-font-charset:204;
    mso-number-format:General;
    text-align:general;
    vertical-align:bottom;
    border:none;
    mso-background-source:auto;
    mso-pattern:auto;
    mso-protection:locked visible;
    white-space:nowrap;
    mso-rotate:0;}
.xl65
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    border:.5pt solid windowtext;}
.xl66
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;}
.xl67
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;}
.xl68
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    text-align:right;
    border:.5pt solid windowtext;}
.xl69
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border:.5pt solid windowtext;}
.xl70
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:"" \@"";
    text-align:left;
    border:.5pt solid windowtext;}
.xl71
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:"" \@"";
    text-align:center;
    border:.5pt solid windowtext;}
.xl72
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:""Short Date"";
    text-align:center;
    border:.5pt solid windowtext;}
.xl73
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border:.5pt solid windowtext;
    white-space:normal;}
.xl74
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-weight:700;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    vertical-align:middle;
    border:.5pt solid windowtext;
    white-space:normal;}
.xl75
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-weight:700;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    vertical-align:middle;
    border:.5pt solid windowtext;}
.xl76
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
.xl77
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
.xl78
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    text-align:left;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
-->
</style>
 
</head>
 
<body link=blue vlink=purple class=xl67>
 
<table border=0 cellpadding=0 cellspacing=0 width=609 style='border-collapse:
 collapse;table-layout:auto;width:458pt'>
 <col class=xl67 width=67 style='mso-width-source:userset;mso-width-alt:2450;
 width:50pt'>
 <col class=xl67 width=24 style='mso-width-source:userset;mso-width-alt:877;
 width:18pt'>
 <col class=xl67 width=67 style='mso-width-source:userset;mso-width-alt:2450;
 width:50pt'>
 <col class=xl67 width=78 span=2 style='mso-width-source:userset;mso-width-alt:
 2852;width:59pt'>
 <col class=xl67 width=141 style='mso-width-source:userset;mso-width-alt:5156;
 width:106pt'>
 <col class=xl67 width=154 style='mso-width-source:userset;mso-width-alt:5632;
 width:116pt'>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 width=609 style='height:12.75pt;
  width:458pt'>" & getScalar("SELECT Bank FROM accountorganizer WHERE IDAccountOrganizer=" & ComboBox1.SelectedValue) & "</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 style='height:12.75pt'>Выписка по счету № " & ComboBox1.Text & " 
</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 style='height:12.75pt'>за период с " & Format(DateTimePicker1.Value, "dd-MM-yyyy") & "
  г. по " & Format(DateTimePicker2.Value, "dd-MM-yyyy") & " г. включительно</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td height=17 colspan=7 class=xl66 style='height:12.75pt;mso-ignore:colspan'></td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 height=17 class=xl77 style='height:12.75pt'>Входящий остаток:
  </td>
  <td class=xl78>" & Format(SaldoNach, "#,##0.00") & "</td>
  <td class=xl78>&nbsp;</td>
  <td colspan=2 class=xl76>Дата предыдущей операции: " & PrevDate & " г.</td>
 </tr>
 <tr height=34 style='height:25.5pt'>
  <td height=34 class=xl74 width=67 style='height:25.5pt;border-top:none;
  width:50pt'>Номер документа</td>
  <td class=xl74 width=24 style='border-top:none;border-left:none;width:18pt'>ВО</td>
  <td class=xl74 width=67 style='border-top:none;border-left:none;width:50pt'>Дата
  операции</td>
  <td class=xl74 width=78 style='border-top:none;border-left:none;width:59pt'>Дебет</td>
  <td class=xl74 width=78 style='border-top:none;border-left:none;width:59pt'>Кредет</td>
  <td class=xl74 width=141 style='border-top:none;border-left:none;width:106pt'>Реквизиты
  контрагента</td>
  <td class=xl74 width=154 style='border-top:none;border-left:none;width:116pt'>Основание
  операции</td>
 </tr>" & tr &
 "<tr height=17 style='height:12.75pt'>
  <td height=17 colspan=7 class=xl67 style='height:12.75pt;mso-ignore:colspan'></td>
 </tr>
 
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 rowspan=2 height=34 class=xl75 style='height:25.5pt'>Входящий
  остаток</td>
  <td colspan=3 class=xl75 style='border-left:none'>Оборот за период с " & Format(DateTimePicker1.Value, "dd-MM-yyyy") & "
   г. по " & Format(DateTimePicker2.Value, "dd-MM-yyyy") & " г.</td>
  <td rowspan=2 class=xl75>Исходящий остаток</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=2 height=17 class=xl75 style='height:12.75pt;border-left:none'>Дебет</td>
  <td class=xl75 style='border-top:none;border-left:none'>Кредет</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 height=17 class=xl68 style='height:12.75pt'>" & Format(SaldoNach, "#,##0.00") & "</td>
  <td colspan=2 class=xl68 style='border-left:none'>" & Format(Kredit, "#,##0.00") & "</td>
  <td class=xl68 style='border-top:none;border-left:none'>" & Format(debet, "#,##0.00") & "</td>
  <td class=xl68 style='border-top:none;border-left:none'>" & Format(SaldoCon, "#,##0.00") & "</td>
 </tr>
 </table>
</body>
</html>
"
        Else
 
        End If
      'здесь показываю выписку
        WebBrowser1.Document.OpenNew(False)
        WebBrowser1.Document.Write(BodyHtml)
        'WebBrowser1.DocumentText = BodyHtml
        WebBrowser1.Refresh()
        'WebBrowser1.Update()
 
    End Sub
Как можно это подправит?
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
14.10.2019, 21:52
Ответы с готовыми решениями:

Отображение в TextBox адреса страницы WebBrowser
Как сделать так, чтобы при открытии любой страницы в webbrouser в textbox показывался вместо текста адресс страницы (например...

Изменение кода страницы и отображение ее в WebBrowser
Имеется сайт нужно изменить одну ссылку изображения и другие теги и получившийся результат ввыводить на webbrowser1 помогите пожалуйста в...

Отображение локальной web страницы в webbrowser
В общем есть готовая простая web страничка содержащая одну таблицу. Первая строка таблицы окрашена. Открываю в хроме, мозиле отображается...

5
Администратор
Эксперт .NET
 Аватар для OwenGlendower
18298 / 14222 / 5368
Регистрация: 17.03.2014
Сообщений: 28,898
Записей в блоге: 1
14.10.2019, 23:20
Georgy0016, думаю поможет вынос кода формирования отчета в BackgroundWorker. Добавь его на форму под именем bgWorker и вставь следующий код вместо своего
VB.NET
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
    Private Sub BgWorker_DoWork(sender As Object, e As DoWorkEventArgs) Handles bgWorker.DoWork
        'здесь начинаю формировать выписку
        If ComboBox1.SelectedValue <> 0 Then
            Dim SqlRsh As String = " AND IDAccountOrganizer=" & ComboBox1.SelectedValue
            ' сальдо на начало
            Dim SaldoNach As Decimal = getDec("SELECT((SELECT SUM(AmountOrder) As Postupl FROM paymentorder 
WHERE IDDirectionOrder=1 AND DatePaymentOrder<'" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "'" & SqlRsh &
    ")-(SELECT SUM(AmountOrder) As Spisan FROM paymentorder WHERE IDDirectionOrder=2 AND 
DatePaymentOrder<'" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "'" & SqlRsh & ")) AS SaldoNach FROM paymentorder")
            ' Обороты за период
            Dim debet As Decimal = getDec("SELECT SUM(AmountOrder) As Postupl FROM paymentorder WHERE IDDirectionOrder=1 AND DatePaymentOrder>='" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(DateTimePicker2.Value, "yyyy-MM-dd") & "' " & SqlRsh)
            Dim Kredit As Decimal = getDec("SELECT SUM(AmountOrder) As Postupl FROM paymentorder WHERE IDDirectionOrder=2 AND DatePaymentOrder>='" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(DateTimePicker2.Value, "yyyy-MM-dd") & "' " & SqlRsh)
            ' Сальдо на конец периода
            Dim SaldoCon As Decimal = SaldoNach - Kredit + debet
 
            Dim PrevDate As String = getScalar("SELECT MAX(DatePaymentOrder) FROM paymentorder WHERE DatePaymentOrder<'" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' " & SqlRsh)
            'документы оборота за период
            Dim DocObr As DataTable = getDataTable("SELECT * FROM paymentorder WHERE DatePaymentOrder>='" & Format(DateTimePicker1.Value, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(DateTimePicker2.Value, "yyyy-MM-dd") & "' " & SqlRsh, "DocObr")
            Dim tr As String = ""
            If DocObr.Rows.Count = 0 Then
                tr = "<tr height=51 style='height:38.25pt'>
  <td height=51 class=xl70 style='height:38.25pt;border-top:none'></td>
  <td class=xl71 style='border-top:none;border-left:none'></td>
  <td class=xl72 style='border-top:none;border-left:none'></td>
  <td class=xl65 align=right style='border-top:none;border-left:none'></td>
  <td class=xl65 align=right style='border-top:none;border-left:none'></td>
  <td class=xl73 width=141 style='border-top:none;border-left:none;width:106pt'><br>
    <br>
    </td>
  <td class=xl69 style='border-top:none;border-left:none'></td>
 </tr>"
            End If
 
            For i As Integer = 0 To DocObr.Rows.Count - 1
                'распределяем сумму по дебету кредету
                Dim dbt As String = ""
                Dim kred As String = ""
                If DocObr(i)("IDDirectionOrder") = 1 Then
                    kred = Format(DocObr(i)("AmountOrder"), "#,##0.00")
                Else
                    dbt = Format(DocObr(i)("AmountOrder"), "#,##0.00")
                End If
                ' получаем данные по контрагенту
                Dim dtContr As DataTable = getDataTable("SELECT NameContractor, INNContractor, 
(SELECT Rsch FROM accountcontractors WHERE IDAccountContractor=" & DocObr(i)("IDAccountContr") & ") As AccauntContr 
FROM `contractors` WHERE IDContractor=" & DocObr(i)("IDContr"), "dtContr")
                Dim cont As String = "ИНН " & dtContr(0)("INNContractor") & "<br>" & "Р/сч.№ " & dtContr(0)("AccauntContr") & "<br>" & dtContr(0)("NameContractor")
 
                tr = tr & "<tr height=51 style='height:38.25pt'>
  <td height=51 class=xl70 style='height:38.25pt;border-top:none'>" & DocObr(i)("NumberPaymentOrder") & "</td>
  <td class=xl71 style='border-top:none;border-left:none'>" & DocObr(i)("Wagetype") & "</td>
  <td class=xl72 style='border-top:none;border-left:none'>" & DocObr(i)("DatePaymentOrder") & "</td>
  <td class=xl65 align=right style='border-top:none;border-left:none'>" & dbt & "</td>
  <td class=xl65 align=right style='border-top:none;border-left:none'>" & kred & "</td>
  <td class=xl73 width=141 style='border-top:none;border-left:none;width:106pt'>" & cont & "</td>
  <td class=xl69 style='border-top:none;border-left:none'>" & DocObr(i)("PurposePayment") & "</td>
 </tr>"
            Next
 
 
            Dim BodyHtml As String = "
<html xmlns:v=""urn:schemas-Microsoft - com: vml""
xmlns:o=""urn: schemas-Microsoft - com: office : office""
xmlns:x=""urn: schemas-Microsoft - com: office : excel""
xmlns=""http://www.w3.org/TR/REC-html40"">
 
<head>
<meta http-equiv=Content-Type content=""text/html; charset=windows-1251"">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content=""Microsoft Excel 12"">
<style>
<!--table
    {mso-displayed-decimal-separator:"" \,"";
    mso-displayed-thousand-separator:"" "";}
@page
    {margin:.75in .7in .75in .7in;
    mso-header-margin:.3in;
    mso-footer-margin:.3in;}
 
tr
    {mso-height-source:auto;}
col
    {mso-width-source:auto;}
br
    {mso-data-placement:same-cell;}
.style0
    {mso-number-format:General;
    text-align:general;
    vertical-align:bottom;
    white-space:nowrap;
    mso-rotate:0;
    mso-background-source:auto;
    mso-pattern:auto;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:Calibri, sans-serif;
    mso-font-charset:204;
    border:none;
    mso-protection:locked visible;
    mso-style-name:Обычный;
    mso-style-id:0;}
td
    {mso-style-parent:style0;
    padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:Calibri, sans-serif;
    mso-font-charset:204;
    mso-number-format:General;
    text-align:general;
    vertical-align:bottom;
    border:none;
    mso-background-source:auto;
    mso-pattern:auto;
    mso-protection:locked visible;
    white-space:nowrap;
    mso-rotate:0;}
.xl65
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    border:.5pt solid windowtext;}
.xl66
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;}
.xl67
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;}
.xl68
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    text-align:right;
    border:.5pt solid windowtext;}
.xl69
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border:.5pt solid windowtext;}
.xl70
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:"" \@"";
    text-align:left;
    border:.5pt solid windowtext;}
.xl71
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:"" \@"";
    text-align:center;
    border:.5pt solid windowtext;}
.xl72
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:""Short Date"";
    text-align:center;
    border:.5pt solid windowtext;}
.xl73
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border:.5pt solid windowtext;
    white-space:normal;}
.xl74
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-weight:700;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    vertical-align:middle;
    border:.5pt solid windowtext;
    white-space:normal;}
.xl75
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-weight:700;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    vertical-align:middle;
    border:.5pt solid windowtext;}
.xl76
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
.xl77
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
.xl78
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    text-align:left;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
-->
</style>
 
</head>
 
<body link=blue vlink=purple class=xl67>
 
<table border=0 cellpadding=0 cellspacing=0 width=609 style='border-collapse:
 collapse;table-layout:auto;width:458pt'>
 <col class=xl67 width=67 style='mso-width-source:userset;mso-width-alt:2450;
 width:50pt'>
 <col class=xl67 width=24 style='mso-width-source:userset;mso-width-alt:877;
 width:18pt'>
 <col class=xl67 width=67 style='mso-width-source:userset;mso-width-alt:2450;
 width:50pt'>
 <col class=xl67 width=78 span=2 style='mso-width-source:userset;mso-width-alt:
 2852;width:59pt'>
 <col class=xl67 width=141 style='mso-width-source:userset;mso-width-alt:5156;
 width:106pt'>
 <col class=xl67 width=154 style='mso-width-source:userset;mso-width-alt:5632;
 width:116pt'>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 width=609 style='height:12.75pt;
  width:458pt'>" & getScalar("SELECT Bank FROM accountorganizer WHERE IDAccountOrganizer=" & ComboBox1.SelectedValue) & "</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 style='height:12.75pt'>Выписка по счету № " & ComboBox1.Text & " 
</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 style='height:12.75pt'>за период с " & Format(DateTimePicker1.Value, "dd-MM-yyyy") & "
  г. по " & Format(DateTimePicker2.Value, "dd-MM-yyyy") & " г. включительно</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td height=17 colspan=7 class=xl66 style='height:12.75pt;mso-ignore:colspan'></td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 height=17 class=xl77 style='height:12.75pt'>Входящий остаток:
  </td>
  <td class=xl78>" & Format(SaldoNach, "#,##0.00") & "</td>
  <td class=xl78>&nbsp;</td>
  <td colspan=2 class=xl76>Дата предыдущей операции: " & PrevDate & " г.</td>
 </tr>
 <tr height=34 style='height:25.5pt'>
  <td height=34 class=xl74 width=67 style='height:25.5pt;border-top:none;
  width:50pt'>Номер документа</td>
  <td class=xl74 width=24 style='border-top:none;border-left:none;width:18pt'>ВО</td>
  <td class=xl74 width=67 style='border-top:none;border-left:none;width:50pt'>Дата
  операции</td>
  <td class=xl74 width=78 style='border-top:none;border-left:none;width:59pt'>Дебет</td>
  <td class=xl74 width=78 style='border-top:none;border-left:none;width:59pt'>Кредет</td>
  <td class=xl74 width=141 style='border-top:none;border-left:none;width:106pt'>Реквизиты
  контрагента</td>
  <td class=xl74 width=154 style='border-top:none;border-left:none;width:116pt'>Основание
  операции</td>
 </tr>" & tr &
    "<tr height=17 style='height:12.75pt'>
  <td height=17 colspan=7 class=xl67 style='height:12.75pt;mso-ignore:colspan'></td>
 </tr>
 
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 rowspan=2 height=34 class=xl75 style='height:25.5pt'>Входящий
  остаток</td>
  <td colspan=3 class=xl75 style='border-left:none'>Оборот за период с " & Format(DateTimePicker1.Value, "dd-MM-yyyy") & "
   г. по " & Format(DateTimePicker2.Value, "dd-MM-yyyy") & " г.</td>
  <td rowspan=2 class=xl75>Исходящий остаток</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=2 height=17 class=xl75 style='height:12.75pt;border-left:none'>Дебет</td>
  <td class=xl75 style='border-top:none;border-left:none'>Кредет</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 height=17 class=xl68 style='height:12.75pt'>" & Format(SaldoNach, "#,##0.00") & "</td>
  <td colspan=2 class=xl68 style='border-left:none'>" & Format(Kredit, "#,##0.00") & "</td>
  <td class=xl68 style='border-top:none;border-left:none'>" & Format(debet, "#,##0.00") & "</td>
  <td class=xl68 style='border-top:none;border-left:none'>" & Format(SaldoCon, "#,##0.00") & "</td>
 </tr>
 </table>
</body>
</html>
"
            e.Result = BodyHtml
 
        Else
 
        End If
    End Sub
 
    Private Sub BgWorker_RunWorkerCompleted(sender As Object, e As RunWorkerCompletedEventArgs) Handles bgWorker.RunWorkerCompleted
        Dim BodyHtml As String = CType(e.Result, String)
        
        'здесь показываю выписку
        WebBrowser1.Document.OpenNew(False)
        WebBrowser1.Document.Write(BodyHtml)
        'WebBrowser1.DocumentText = BodyHtml
        WebBrowser1.Refresh()
        'WebBrowser1.Update()        
        
        ToolStripButton3.Enabled = True
        
    End Sub
    
    Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles ToolStripButton3.Click
        Dim BodyHtml As String = "<!DOCTYPE html>
<html lang='ru' >
<head>
    <meta charset='utf-8' />
<title></title>
        <style>
body{
background-color:#F8F8FF
}
</style>
</head>
<body>
<div align='center'><H3> Подождите идет формирование выписки банка!  </H3></div>
<div align='center'>  <img src='" & Application.StartupPath & "\img\LoadGif.gif'" & " width='240' height='200' alt='LoadGif'>
</div>
</body>
</html>
"
        'здесь показываю страницу ожидания
        WebBrowser1.Document.OpenNew(False)
        WebBrowser1.Document.Write(BodyHtml)
        WebBrowser1.Refresh()
        
        bgWorker.RunWorkerAsync()
        ToolStripButton3.Enabled = False ' Запрещаем кнопку пока идет формирование выписки
        
    End Sub
Добавлено через 1 минуту
По хорошему стоит еще вынести код формирования выписки в отдельный класс или модуль чтобы не усложнять код формы и отделить его от логики формирования выписки.
1
32 / 4 / 0
Регистрация: 23.11.2016
Сообщений: 39
15.10.2019, 08:47  [ТС]
OwenGlendower, большое спасибо за направление.
Я всегда избегал много поточности, так как не умею разруливать делегирование.
Вот и сейчас попробовал сделать как Вы посоветовали, в процедуре BgWorker_DoWork
выходит исключение при обращении к ComboBox1, так как он был создан не в этом потоке.
Я понимаю что как-то надо прикрутить сюда делегатов, но как я просто не понимаю!
Может поможете разобраться с делегатами.
0
Лень — мое второе и
 Аватар для Orlangur
3228 / 2416 / 687
Регистрация: 28.11.2014
Сообщений: 3,601
Записей в блоге: 3
15.10.2019, 09:16
Georgy0016,обращайтесь к контролам через invoke, к примеру, в начале создайте переменную, которая будет хранить значение combobox
VB.NET
1
2
3
4
5
 Dim ComboValue As Integer = 0
        Invoke(Sub() ComboValue = ComboBox1.SelectedIndex)
        If ComboValue <> 0 Then
           'что-то делаем
        End If
1
Администратор
Эксперт .NET
 Аватар для OwenGlendower
18298 / 14222 / 5368
Регистрация: 17.03.2014
Сообщений: 28,898
Записей в блоге: 1
15.10.2019, 09:56
Georgy0016, можно сделать через Invoke как показал Orlangur1991, но я советую поступить по другому и заранее получить данные из элементов управления будучи в UI потоке и передать их в BackgroundWorker. Для это делаем класс для передачи параметров выписки
VB.NET
1
2
3
4
5
6
Class ReportParams
    Public Dim Id As Integer
    Public Dim Name As String
    Public Dim Date1 As DateTime
    Public Dim Date2 As DateTime
End Class
Передаем его экземпляр в BackgroundWorker при запуске
VB.NET
1
2
3
4
5
6
7
Dim params As New ReportParams With { _
    .Id = ComboBox1.SelectedValue, _
    .Name = ComboBox1.Text, _
    .Date1 = DateTimePicker1.Value, _
    .Date2 = DateTimePicker2.Value _
}
bgWorker.RunWorkerAsync(params)
В обработчике события DoWork получаем params и заменяем обращения к эементам управления на обращения к его полям
VB.NET
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
    Private Sub BgWorker_DoWork(sender As Object, e As DoWorkEventArgs) Handles bgWorker.DoWork
        Dim params As ReportParams = CType(e.Argument, ReportParams)
        
        'здесь начинаю формировать выписку
        If params.Id <> 0 Then
            Dim SqlRsh As String = " AND IDAccountOrganizer=" & params.Id
            ' сальдо на начало
            Dim SaldoNach As Decimal = getDec("SELECT((SELECT SUM(AmountOrder) As Postupl FROM paymentorder 
WHERE IDDirectionOrder=1 AND DatePaymentOrder<'" & Format(params.Date1, "yyyy-MM-dd") & "'" & SqlRsh &
    ")-(SELECT SUM(AmountOrder) As Spisan FROM paymentorder WHERE IDDirectionOrder=2 AND 
DatePaymentOrder<'" & Format(params.Date1, "yyyy-MM-dd") & "'" & SqlRsh & ")) AS SaldoNach FROM paymentorder")
            ' Обороты за период
            Dim debet As Decimal = getDec("SELECT SUM(AmountOrder) As Postupl FROM paymentorder WHERE IDDirectionOrder=1 AND DatePaymentOrder>='" & Format(params.Date1, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(params.Date2, "yyyy-MM-dd") & "' " & SqlRsh)
            Dim Kredit As Decimal = getDec("SELECT SUM(AmountOrder) As Postupl FROM paymentorder WHERE IDDirectionOrder=2 AND DatePaymentOrder>='" & Format(params.Date1, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(params.Date2, "yyyy-MM-dd") & "' " & SqlRsh)
            ' Сальдо на конец периода
            Dim SaldoCon As Decimal = SaldoNach - Kredit + debet
 
            Dim PrevDate As String = getScalar("SELECT MAX(DatePaymentOrder) FROM paymentorder WHERE DatePaymentOrder<'" & Format(params.Date1, "yyyy-MM-dd") & "' " & SqlRsh)
            'документы оборота за период
            Dim DocObr As DataTable = getDataTable("SELECT * FROM paymentorder WHERE DatePaymentOrder>='" & Format(params.Date1, "yyyy-MM-dd") & "' AND DatePaymentOrder<='" & Format(params.Date2, "yyyy-MM-dd") & "' " & SqlRsh, "DocObr")
            Dim tr As String = ""
            If DocObr.Rows.Count = 0 Then
                tr = "<tr height=51 style='height:38.25pt'>
  <td height=51 class=xl70 style='height:38.25pt;border-top:none'></td>
  <td class=xl71 style='border-top:none;border-left:none'></td>
  <td class=xl72 style='border-top:none;border-left:none'></td>
  <td class=xl65 align=right style='border-top:none;border-left:none'></td>
  <td class=xl65 align=right style='border-top:none;border-left:none'></td>
  <td class=xl73 width=141 style='border-top:none;border-left:none;width:106pt'><br>
    <br>
    </td>
  <td class=xl69 style='border-top:none;border-left:none'></td>
 </tr>"
            End If
 
            For i As Integer = 0 To DocObr.Rows.Count - 1
                'распределяем сумму по дебету кредету
                Dim dbt As String = ""
                Dim kred As String = ""
                If DocObr(i)("IDDirectionOrder") = 1 Then
                    kred = Format(DocObr(i)("AmountOrder"), "#,##0.00")
                Else
                    dbt = Format(DocObr(i)("AmountOrder"), "#,##0.00")
                End If
                ' получаем данные по контрагенту
                Dim dtContr As DataTable = getDataTable("SELECT NameContractor, INNContractor, 
(SELECT Rsch FROM accountcontractors WHERE IDAccountContractor=" & DocObr(i)("IDAccountContr") & ") As AccauntContr 
FROM `contractors` WHERE IDContractor=" & DocObr(i)("IDContr"), "dtContr")
                Dim cont As String = "ИНН " & dtContr(0)("INNContractor") & "<br>" & "Р/сч.№ " & dtContr(0)("AccauntContr") & "<br>" & dtContr(0)("NameContractor")
 
                tr = tr & "<tr height=51 style='height:38.25pt'>
  <td height=51 class=xl70 style='height:38.25pt;border-top:none'>" & DocObr(i)("NumberPaymentOrder") & "</td>
  <td class=xl71 style='border-top:none;border-left:none'>" & DocObr(i)("Wagetype") & "</td>
  <td class=xl72 style='border-top:none;border-left:none'>" & DocObr(i)("DatePaymentOrder") & "</td>
  <td class=xl65 align=right style='border-top:none;border-left:none'>" & dbt & "</td>
  <td class=xl65 align=right style='border-top:none;border-left:none'>" & kred & "</td>
  <td class=xl73 width=141 style='border-top:none;border-left:none;width:106pt'>" & cont & "</td>
  <td class=xl69 style='border-top:none;border-left:none'>" & DocObr(i)("PurposePayment") & "</td>
 </tr>"
            Next
 
 
            Dim BodyHtml As String = "
<html xmlns:v=""urn:schemas-Microsoft - com: vml""
xmlns:o=""urn: schemas-Microsoft - com: office : office""
xmlns:x=""urn: schemas-Microsoft - com: office : excel""
xmlns=""http://www.w3.org/TR/REC-html40"">
 
<head>
<meta http-equiv=Content-Type content=""text/html; charset=windows-1251"">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content=""Microsoft Excel 12"">
<style>
<!--table
    {mso-displayed-decimal-separator:"" \,"";
    mso-displayed-thousand-separator:"" "";}
@page
    {margin:.75in .7in .75in .7in;
    mso-header-margin:.3in;
    mso-footer-margin:.3in;}
 
tr
    {mso-height-source:auto;}
col
    {mso-width-source:auto;}
br
    {mso-data-placement:same-cell;}
.style0
    {mso-number-format:General;
    text-align:general;
    vertical-align:bottom;
    white-space:nowrap;
    mso-rotate:0;
    mso-background-source:auto;
    mso-pattern:auto;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:Calibri, sans-serif;
    mso-font-charset:204;
    border:none;
    mso-protection:locked visible;
    mso-style-name:Обычный;
    mso-style-id:0;}
td
    {mso-style-parent:style0;
    padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:Calibri, sans-serif;
    mso-font-charset:204;
    mso-number-format:General;
    text-align:general;
    vertical-align:bottom;
    border:none;
    mso-background-source:auto;
    mso-pattern:auto;
    mso-protection:locked visible;
    white-space:nowrap;
    mso-rotate:0;}
.xl65
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    border:.5pt solid windowtext;}
.xl66
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;}
.xl67
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;}
.xl68
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    text-align:right;
    border:.5pt solid windowtext;}
.xl69
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border:.5pt solid windowtext;}
.xl70
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:"" \@"";
    text-align:left;
    border:.5pt solid windowtext;}
.xl71
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:"" \@"";
    text-align:center;
    border:.5pt solid windowtext;}
.xl72
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:""Short Date"";
    text-align:center;
    border:.5pt solid windowtext;}
.xl73
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border:.5pt solid windowtext;
    white-space:normal;}
.xl74
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-weight:700;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    vertical-align:middle;
    border:.5pt solid windowtext;
    white-space:normal;}
.xl75
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-weight:700;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    vertical-align:middle;
    border:.5pt solid windowtext;}
.xl76
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:center;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
.xl77
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    text-align:left;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
.xl78
    {mso-style-parent:style0;
    font-size:10.0pt;
    font-family:""Times New Roman"", serif;
    mso-font-charset:204;
    mso-number-format:Fixed;
    text-align:left;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;}
-->
</style>
 
</head>
 
<body link=blue vlink=purple class=xl67>
 
<table border=0 cellpadding=0 cellspacing=0 width=609 style='border-collapse:
 collapse;table-layout:auto;width:458pt'>
 <col class=xl67 width=67 style='mso-width-source:userset;mso-width-alt:2450;
 width:50pt'>
 <col class=xl67 width=24 style='mso-width-source:userset;mso-width-alt:877;
 width:18pt'>
 <col class=xl67 width=67 style='mso-width-source:userset;mso-width-alt:2450;
 width:50pt'>
 <col class=xl67 width=78 span=2 style='mso-width-source:userset;mso-width-alt:
 2852;width:59pt'>
 <col class=xl67 width=141 style='mso-width-source:userset;mso-width-alt:5156;
 width:106pt'>
 <col class=xl67 width=154 style='mso-width-source:userset;mso-width-alt:5632;
 width:116pt'>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 width=609 style='height:12.75pt;
  width:458pt'>" & getScalar("SELECT Bank FROM accountorganizer WHERE IDAccountOrganizer=" & params.Id) & "</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 style='height:12.75pt'>Выписка по счету № " & params.Name & " 
</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=7 height=17 class=xl66 style='height:12.75pt'>за период с " & Format(params.Date1, "dd-MM-yyyy") & "
  г. по " & Format(params.Date2, "dd-MM-yyyy") & " г. включительно</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td height=17 colspan=7 class=xl66 style='height:12.75pt;mso-ignore:colspan'></td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 height=17 class=xl77 style='height:12.75pt'>Входящий остаток:
  </td>
  <td class=xl78>" & Format(SaldoNach, "#,##0.00") & "</td>
  <td class=xl78>&nbsp;</td>
  <td colspan=2 class=xl76>Дата предыдущей операции: " & PrevDate & " г.</td>
 </tr>
 <tr height=34 style='height:25.5pt'>
  <td height=34 class=xl74 width=67 style='height:25.5pt;border-top:none;
  width:50pt'>Номер документа</td>
  <td class=xl74 width=24 style='border-top:none;border-left:none;width:18pt'>ВО</td>
  <td class=xl74 width=67 style='border-top:none;border-left:none;width:50pt'>Дата
  операции</td>
  <td class=xl74 width=78 style='border-top:none;border-left:none;width:59pt'>Дебет</td>
  <td class=xl74 width=78 style='border-top:none;border-left:none;width:59pt'>Кредет</td>
  <td class=xl74 width=141 style='border-top:none;border-left:none;width:106pt'>Реквизиты
  контрагента</td>
  <td class=xl74 width=154 style='border-top:none;border-left:none;width:116pt'>Основание
  операции</td>
 </tr>" & tr &
    "<tr height=17 style='height:12.75pt'>
  <td height=17 colspan=7 class=xl67 style='height:12.75pt;mso-ignore:colspan'></td>
 </tr>
 
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 rowspan=2 height=34 class=xl75 style='height:25.5pt'>Входящий
  остаток</td>
  <td colspan=3 class=xl75 style='border-left:none'>Оборот за период с " & Format(params.Date1, "dd-MM-yyyy") & "
   г. по " & Format(params.Date2, "dd-MM-yyyy") & " г.</td>
  <td rowspan=2 class=xl75>Исходящий остаток</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=2 height=17 class=xl75 style='height:12.75pt;border-left:none'>Дебет</td>
  <td class=xl75 style='border-top:none;border-left:none'>Кредет</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td colspan=3 height=17 class=xl68 style='height:12.75pt'>" & Format(SaldoNach, "#,##0.00") & "</td>
  <td colspan=2 class=xl68 style='border-left:none'>" & Format(Kredit, "#,##0.00") & "</td>
  <td class=xl68 style='border-top:none;border-left:none'>" & Format(debet, "#,##0.00") & "</td>
  <td class=xl68 style='border-top:none;border-left:none'>" & Format(SaldoCon, "#,##0.00") & "</td>
 </tr>
 </table>
</body>
</html>
"
            e.Result = BodyHtml
 
        Else
 
        End If
    End Sub
3
32 / 4 / 0
Регистрация: 23.11.2016
Сообщений: 39
15.10.2019, 10:16  [ТС]
Огромное спасибо за ваши ответы.
Остановлюсь на варианте OwenGlendower и буду учится передавать параметры в поток.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
15.10.2019, 10:16
Помогаю со студенческими работами здесь

Отображение html-страницы в WebBrowser из текстовой переменной
как открыть браузером страницу,созданную прямо во время выполнения программы т.е. var s:string; begin ...

Отключить отображение страницы до полной ее загрузки в WebBrowser
Через веббраузер грузятся изображения, которые надо обновлять каждые 3 сек. После вызова Refresh страница очищается и грузится заново. Как...

Добавление файл или адрес веб-страницы в БД и отображение в WebBrowser
В Accesse в таблице есть поле с типом данных Гиперссылка. заполнил несколько записей в Accesse потом подключил Таблицу в Delpji. 1)При...

WebBrowser. Как получить Html код страницы открытой в "webBrowser" в правильной кодировке?
Пробую получить Html код страницы открытой в &quot;webBrowser&quot;. public string GetHTMLCodPage() { string htmlCodPage; ...

Некорректное отображение в WebBrowser
Во всех браузерах,в том числе IE страница отображается корректно. Когда я пытаюсь ее загрузить через Windows.Forms.WebBrouser вылетает...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
6
Ответ Создать тему
Новые блоги и статьи
BOINC: 22 года — и всё ещё работает
Programma_Boinc 12.03.2026
BOINC: 22 года — и всё ещё работает Дэвид Андерсон написал ретроспективу. Кратко: в 2001 году он ушёл из United Devices, где был CTO, и за несколько месяцев написал ядро BOINC — клиент, сервер,. . .
SDL3 для Desktop (MinGW): Создаём пустое окно с нуля для 2D-графики на SDL3, Си и C++
8Observer8 10.03.2026
Содержание блога Финальные проекты на Си и на C++: hello-sdl3-c. zip hello-sdl3-cpp. zip Результат:
Установка CMake и MinGW 13.1 для сборки С и C++ приложений из консоли и из Qt Creator в EXE
8Observer8 10.03.2026
Содержание блога MinGW - это коллекция инструментов для сборки приложений в EXE. CMake - это система сборки приложений. Здесь описаны базовые шаги для старта программирования с помощью CMake и. . .
Как дизайн сайта влияет на конверсию: 7 решений, которые реально повышают заявки
Neotwalker 08.03.2026
Многие до сих пор воспринимают дизайн сайта как “красивую оболочку”. На практике всё иначе: дизайн напрямую влияет на то, оставит человек заявку или уйдёт через несколько секунд. Даже если у вас. . .
Модульная разработка через nuget packages
DevAlt 07.03.2026
Сложившийся в . Net-среде способ разработки чаще всего предполагает монорепозиторий в котором находятся все исходники. При создании нового решения, мы просто добавляем нужные проекты и имеем. . .
Модульный подход на примере F#
DevAlt 06.03.2026
В блоге дяди Боба наткнулся на такое определение: В этой книге («Подход, основанный на вариантах использования») Ивар утверждает, что архитектура программного обеспечения — это структуры,. . .
Управление камерой с помощью скрипта OrbitControls.js на Three.js: Вращение, зум и панорамирование
8Observer8 05.03.2026
Содержание блога Финальная демка в браузере работает на Desktop и мобильных браузерах. Итоговый код: orbit-controls-threejs-js. zip. Сканируйте QR-код на мобильном. Вращайте камеру одним пальцем,. . .
SDL3 для Web (WebAssembly): Синхронизация спрайтов SDL3 и тел Box2D
8Observer8 04.03.2026
Содержание блога Финальная демка в браузере. Итоговый код: finish-sync-physics-sprites-sdl3-c. zip На первой гифке отладочные линии отключены, а на второй включены:. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru