دوست عزیز جواب سوالتون تابلو هست و توی انجمن موجوده من خودم یه نمونه مثال کامل توی انجمن قرار دادم حتی توی امضا خودمم قرار دادم میتونید نگاه کنید
برای این کار باید از طریق کد های html استفاده کنید یعنی به تعداد فیلد های دیتابیس ستون و به تعداد داده ها سطر ایجاد کنید و داده ها رو فراخوانی و با mmb یه فایل خروجی html بسازید و از اون پرینت بگیرید این به نظرم روش خوب و مناسبی هست
filename$ = '<SrcDir>\Print.html'
empty$ = ''
rt = StrToFile(filename$,empty$,FALSE,TRUE)
*****************************
line$[1] = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'
line$[2] = '<html>'
line$[3] = '<head>'
line$[4] = '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">'
line$[5] = '<meta http-equiv="Content-Language" content="fa">'
line$[6] = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
line$[7] = '<title>Print List</title>'
line$[8] = '<style type="text/css">body{ background-color: #FFFFFF; color: #000000;}'
line$[9] = '</style>'
line$[10] = '</head>'
line$[11] = '<body>'
line$[12] = '<div id="wb_Image1" style="margin:0;padding:0;position:absolute;left:0px;top:0px;width:481px;height:227px;text-align:left;z-index:1;">'
line$[13] = '<img src="images/BGIMG.png" id="Image1" alt="" border="0" style="width:481px;height:227px;"></div>'
line$[14] = '<div id="wb_Text1" style="margin:0;padding:0;position:absolute;left:149px;top:12px;width:235px;height:16px;text-align:right;z-index:2;">'
line$[15] = '<font style="font-size:13px" color="#000000" face="Tahoma">'+Numberozv$+'</font></div>'
line$[16] = '<div id="wb_Text2" style="margin:0;padding:0;position:absolute;left:150px;top:51px;width:235px;height:16px;text-align:right;z-index:3;">'
line$[17] = '<font style="font-size:13px" color="#000000" face="Tahoma">'+Name$+'</font></div>'
line$[18] = '<div id="wb_Text3" style="margin:0;padding:0;position:absolute;left:150px;top:87px;width:235px;height:16px;text-align:right;z-index:4;">'
line$[19] = '<font style="font-size:13px" color="#000000" face="Tahoma">'+LName$+'</font></div>'
line$[20] = '<div id="wb_Text4" style="margin:0;padding:0;position:absolute;left:150px;top:122px;width:235px;height:16px;text-align:right;z-index:5;">'
line$[21] = '<font style="font-size:13px" color="#000000" face="Tahoma">'+Data$+'</font></div>'
line$[22] = '<div id="wb_Text5" style="margin:0;padding:0;position:absolute;left:117px;top:160px;width:268px;height:16px;text-align:right;z-index:6;">'
line$[23] = '<font style="font-size:13px" color="#000000" face="Tahoma">'+Tel$+'</font></div>'
line$[24] = '<div id="wb_Text6" style="margin:0;padding:0;position:absolute;left:4px;top:197px;width:381px;height:16px;text-align:right;z-index:7;">'
line$[25] = '<font style="font-size:13px" color="#000000" face="Tahoma">'+Adres$+'</font></div>'
line$[26] = '<div id="wb_Image2" style="margin:0;padding:0;position:absolute;left:10px;top:29px;width:122px;height:110px;text-align:left;z-index:8;">'
line$[27] = '<img src="'+'Picture'+CHR(92)+EImage$+'" id="Image2" alt="" border="0" style="width:122px;height:110px;"></div>'
line$[28] = '</body>'
line$[29] = '</html>'
For i=1To29
drt = StrToFile(filename$,line$,TRUE,TRUE)
Next i
FileExist("filename$","isThere")
If (isThere = 1) Then
Browser("Browser","filename$")
Browser("Browser","Print")
Else
Message("Nothing To Print!","")
Return()
End
[LEFT]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.FontStyle {
font-family: Tahoma;
}
</style>
</head>
<body>
<table width="607" height="83" border="0">
<tr class="Header">
<th width="33" height="27" bgcolor="#00CCFF" scope="col"> </th>
<th width="115" bgcolor="#00CCFF" scope="col"><strong>Col1</strong></th>
<th width="152" bgcolor="#00CCFF" scope="col"><strong>Col2</strong></th>
<th width="76" bgcolor="#00CCFF" scope="col"><strong>Col3</strong></th>
<th width="110" bgcolor="#00CCFF" scope="col"><strong>Col4</strong></th>
<th width="81" bgcolor="#00CCFF" scope="col"><strong>Col5</strong></th>
</tr>
<tr> <th height="23" bgcolor="#00CCFF" scope="row">1</th>
<td class="FontStyle">Sample1</td>
<td class="FontStyle">Sample2</td>
<td class="FontStyle">------</td>
<td class="FontStyle">hi</td>
<td class="FontStyle">hello</td>
</tr>
<tr>
<th height="23" bgcolor="#00CCFF" scope="row">2</th>
<td class="FontStyle">!!!!!!!!!!!!!</td>
<td class="FontStyle">@@@@@@@@</td>
<td class="FontStyle">#####</td>
<td class="FontStyle">$$$$$</td>
<td class="FontStyle">%%%%</td>
</tr>
</table>
</body>
</html> [/LEFT]
[LEFT]HTML$[[COLOR=#ff0000]1[/COLOR]] = [COLOR=#800000]'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'[/COLOR]
HTML$[[COLOR=#ff0000]2[/COLOR]] = [COLOR=#800000]'<html xmlns="http://www.w3.org/1999/xhtml">'[/COLOR]
HTML$[[COLOR=#ff0000]3[/COLOR]] = [COLOR=#800000]'<head>'[/COLOR]
HTML$[[COLOR=#ff0000]4[/COLOR]] = [COLOR=#800000]'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'[/COLOR]
HTML$[[COLOR=#ff0000]5[/COLOR]] = [COLOR=#800000]'<title>Untitled Document</title>'[/COLOR]
HTML$[[COLOR=#ff0000]6[/COLOR]] = [COLOR=#800000]'<style type="text/css">'[/COLOR]
HTML$[[COLOR=#ff0000]7[/COLOR]] = [COLOR=#800000]'.FontStyle {'[/COLOR]
HTML$[[COLOR=#ff0000]8[/COLOR]] = [COLOR=#800000]' font-family: Tahoma;'[/COLOR]
HTML$[[COLOR=#ff0000]9[/COLOR]] = [COLOR=#800000]'}'[/COLOR]
HTML$[[COLOR=#ff0000]10[/COLOR]] = [COLOR=#800000]'</style>'[/COLOR]
HTML$[[COLOR=#ff0000]11[/COLOR]] = [COLOR=#800000]'</head>'[/COLOR]
HTML$[[COLOR=#ff0000]12[/COLOR]] = [COLOR=#800000]'<body>'[/COLOR]
HTML$[[COLOR=#ff0000]13[/COLOR]] = [COLOR=#800000]'<table width="607" height="83" border="0">'[/COLOR]
HTML$[[COLOR=#ff0000]14[/COLOR]] = [COLOR=#800000]' <tr class="Header">'[/COLOR]
HTML$[[COLOR=#ff0000]15[/COLOR]] = [COLOR=#800000]' <th width="33" height="27" bgcolor="#00CCFF" scope="col"> </th>'[/COLOR]
HTML$[[COLOR=#ff0000]16[/COLOR]] = [COLOR=#800000]' <th width="115" bgcolor="#00CCFF" scope="col"><strong>Col1</strong></th>'[/COLOR]
HTML$[[COLOR=#ff0000]17[/COLOR]] = [COLOR=#800000]' <th width="152" bgcolor="#00CCFF" scope="col"><strong>Col2</strong></th>'[/COLOR]
HTML$[[COLOR=#ff0000]18[/COLOR]] = [COLOR=#800000]' <th width="76" bgcolor="#00CCFF" scope="col"><strong>Col3</strong></th>'[/COLOR]
HTML$[[COLOR=#ff0000]19[/COLOR]] = [COLOR=#800000]' <th width="110" bgcolor="#00CCFF" scope="col"><strong>Col4</strong></th>'[/COLOR]
HTML$[[COLOR=#ff0000]20[/COLOR]] = [COLOR=#800000]' <th width="81" bgcolor="#00CCFF" scope="col"><strong>Col5</strong></th>'[/COLOR]
HTML$[[COLOR=#ff0000]21[/COLOR]] = [COLOR=#800000]' </tr>'[/COLOR]
[COLOR=#009000]*****************************************************************************************[/COLOR]
ReportPath$ = [COLOR=#800000]'<Embedded>\Report.html'[/COLOR]
[COLOR=#009000]**// Since UO has not a method to return available column or their values, we set Number o Columns[/COLOR]
[COLOR=#009000]**// NumOfItems is Number of rows available in ListView[/COLOR]
NumOfCols = [COLOR=#ff0000]5[/COLOR]
[COLOR=#000090][B]PluginRun[/B][/COLOR]("UO","LVItemCount")
[COLOR=#000090][B]PluginGet[/B][/COLOR]("UO","NumOfRows")
NumOfRows = NumOfRows - [COLOR=#ff0000]1[/COLOR]
NumOfCols = NumOfCols - [COLOR=#ff0000]1[/COLOR]
Row$ = [COLOR=#800000]''[/COLOR]
Cell$ = [COLOR=#800000]''[/COLOR]
[COLOR=#009000]*****************************************************************************************[/COLOR]
[COLOR=#0000FF]For[/COLOR] i=[COLOR=#ff0000]0[/COLOR] [COLOR=#0000FF]To[/COLOR] NumOfRows
[COLOR=#009000]**// Looping through Rows[/COLOR]
RowNumber = i + [COLOR=#ff0000]1[/COLOR]
Row$ = Row$ + [COLOR=#800000]' <tr>'[/COLOR] + [COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]10[/COLOR])+[COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]13[/COLOR]) + [COLOR=#800000]' <th height="23" bgcolor="#00CCFF" scope="row">'[/COLOR] + [COLOR=#000090][B]CHAR[/B][/COLOR](RowNumber) + [COLOR=#800000]'</th>'[/COLOR]
[COLOR=#0000FF]For[/COLOR] j=[COLOR=#ff0000]0[/COLOR] [COLOR=#0000FF]To[/COLOR] NumOfCols
[COLOR=#009000]**// Looping through Columns[/COLOR]
[COLOR=#000090][B]PluginSet[/B][/COLOR]("UO","i")
[COLOR=#000090][B]PluginSet[/B][/COLOR]("UO","j")
[COLOR=#000090][B]PluginRun[/B][/COLOR]("UO","LVGetCell")
[COLOR=#000090][B]PluginGet[/B][/COLOR]("UO","Cell$")
Row$ = Row$ + [COLOR=#800000]' <td class="FontStyle">'[/COLOR] + Cell$ + [COLOR=#800000]'</td>'[/COLOR]
[COLOR=#0000FF]Next[/COLOR] j
Row$ = Row$ + [COLOR=#800000]' </tr>'[/COLOR]
[COLOR=#0000FF]Next[/COLOR] i
Report$ = [COLOR=#800000]''[/COLOR]
[COLOR=#0000FF]For[/COLOR] i=[COLOR=#ff0000]1[/COLOR] [COLOR=#0000FF]To[/COLOR] [COLOR=#ff0000]21[/COLOR]
Report$ = Report$ + HTML$[i] + [COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]10[/COLOR])+[COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]13[/COLOR])
[COLOR=#0000FF]Next[/COLOR] i
Report$ = Report$ + Row$ + [COLOR=#800000]'</table>'[/COLOR] + [COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]10[/COLOR])+[COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]13[/COLOR]) + [COLOR=#800000]'</body>'[/COLOR] + [COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]10[/COLOR])+[COLOR=#000090][B]CHR[/B][/COLOR]([COLOR=#ff0000]13[/COLOR]) + [COLOR=#800000]'</html>'[/COLOR]
FileSaved = [COLOR=#000090][B]StrToFile[/B][/COLOR](ReportPath$,Report$,[COLOR=#0000FF]FALSE[/COLOR],[COLOR=#0000FF]TRUE[/COLOR])
[COLOR=#000090][B]Run[/B][/COLOR]("ReportPath$","")[/LEFT]
با سلام
این کدی که نوشتید برای تعداد رکوردهای مشخص هستش یا نه؟
با تشکر
HTML$[1] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
HTML$[2] = '<html xmlns="http://www.w3.org/1999/xhtml">'
HTML$[3] = '<head>'
HTML$[4] = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
HTML$[5] = '<title>ليست اعضاء</title>'
HTML$[6] = '<style type="text/css">'
HTML$[7] = '.FontStyle {'
HTML$[8] = ' font-family: Tahoma;'
HTML$[9] = '}'
HTML$[10] = '</style>'
HTML$[11] = '</head>'
HTML$[12] = '<body>'
HTML$[13] = '<table width="1700" height="83" border="0">'
HTML$[14] = ' <tr class="Header">'
HTML$[15] = ' <th width="33" height="27" bgcolor="#CCCCCC" scope="col"> </th>'
HTML$[16] = ' <th width="60" bgcolor="#CCCCCC" scope="col"><strong>شماره عضو</strong></th>'
HTML$[17] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>نام</strong></th>'
HTML$[18] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>نام خانوادگي</strong></th>'
HTML$[19] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>نام پدر</strong></th>'
HTML$[20] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>شماره شناسنامه</strong></th>'
HTML$[21] = ' <th width="100" bgcolor="#CCCCCC" scope="col"><strong>تاريخ تولد</strong></th>'
HTML$[22] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>تحصيلات</strong></th>'
HTML$[23] = ' <th width="60" bgcolor="#CCCCCC" scope="col"><strong>شغل</strong></th>'
HTML$[24] = ' <th width="100" bgcolor="#CCCCCC" scope="col"><strong>تاريخ عضويت</strong></th>'
HTML$[25] = ' <th width="250" bgcolor="#CCCCCC" scope="col"><strong>آدرس</strong></th>'
HTML$[26] = ' <th width="100" bgcolor="#CCCCCC" scope="col"><strong>تلفن</strong></th>'
HTML$[27] = ' <th width="100" bgcolor="#CCCCCC" scope="col"><strong>موبايل</strong></th>'
HTML$[28] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>عنوان دوره</strong></th>'
HTML$[29] = ' <th width="100" bgcolor="#CCCCCC" scope="col"><strong>هنر آموز</strong></th>'
HTML$[30] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>روز</strong></th>'
HTML$[31] = ' <th width="80" bgcolor="#CCCCCC" scope="col"><strong>ساعت</strong></th>'
HTML$[32] = ' </tr>'
*****************************************************************************************
ReportPath$ = '<SrcDir>\Report.html'
**// Since UO has not a method to return available column or their values, we set Number o Columns
**// NumOfItems is Number of rows available in ListView
NumOfCols = 16
PluginRun("UO_Plugin","LVItemCount")
PluginGet("UO_Plugin","NumOfRows")
NumOfRows = NumOfRows - 1
NumOfCols = NumOfCols - 1
Row$ = ''
Cell$ = ''
*****************************************************************************************
For i=0 To NumOfRows
**// Looping through Rows
RowNumber = i + 1
Row$ = Row$ + ' <tr>' + CHR(10)+CHR(13) + ' <th height="23" bgcolor="#CCCCCC" scope="row">' + CHAR(RowNumber) + '</th>'
For j=0 To NumOfCols
**// Looping through Columns
PluginSet("UO_Plugin","i")
PluginSet("UO_Plugin","j")
PluginRun("UO_Plugin","LVGetCell")
PluginGet("UO_Plugin","Cell$")
Row$ = Row$ + ' <td class="FontStyle">' + Cell$ + '</td>'
Next j
Row$ = Row$ + ' </tr>'
Next i
Report$ = ''
For i=1 To 32
Report$ = Report$ + HTML$[i] + CHR(10)+CHR(13)
Next i
Report$ = Report$ + Row$ + '</table>' + CHR(10)+CHR(13) + '</body>' + CHR(10)+CHR(13) + '</html>'
FileSaved = StrToFile(ReportPath$,Report$,FALSE,TRUE)
filein$ ='<SrcDir>\Report.html'
fileout$ ='<SrcDir>\Reportok.html'
PluginSet("PlugIn1","filein$")
PluginSet("PlugIn1","fileout$")
PluginRun("PlugIn1","uconvert")
PluginGet("PlugIn1","result$")
**Message("result$","")
ReportPath2$ = '<SrcDir>\Reportok.html'
Run("ReportPath2$","")
NumOfCols = 16
PluginRun("UO_Plugin","LVItemCount")
PluginGet("UO_Plugin","NumOfRows")
NumOfRows = NumOfRows - 1
NumOfCols = NumOfCols - 1
Row$ = ''
Cell$ = ''
NumOfCols = 16
PluginRun("UO_Plugin","LVItemCount")
PluginGet("UO_Plugin","NumOfRows")
NumOfCols = NumOfCols - 1
Row$ = ''
Cell$ = ''