我在pdf中有5-10张表格,其中显示了该表格的所有记录,每张都有大约1000-2000条记录。我尝试使用下面的代码在每个页面上添加页脚,而不是在完成表格后显示它。我的模板如下所示
<page backtop="0" backbottom="30mm" footer="page" style="font-size: 9pt">
<table>
<Records>
</table>
<page_footer>
<table class="page_footer" style="width: 100%;">
<tr>
<td style="width: 80%; text-align:center">
<p style='font-size: 6pt;color:red;'>
...Content...
</p>
</td>
</tr>
</table>
</page_footer>
Run Code Online (Sandbox Code Playgroud) 我在codeigniter中使用HTML2PDF库.我正在尝试使用它生成批量pdf.
其中我面临的问题,如每个pdf或pdf相同的内容没有内容.我已经完成了我的作业.但是,总是显示完美的生成第一个pdf(帐号:3)
据我所知,必须有以下代码的问题:
ob_start();
require_once($template_config.'template.php'); //
$content = ob_get_contents();
ob_clean();
Run Code Online (Sandbox Code Playgroud)
问题:它首次运行但第二次刷新内容变量的所有内容,并且由于重复的PDF或没有内容PDF生成.
我尝试过如下
1)在generatetemplate.php中创建对象并传递给common.php
2)尝试使用include_once //在每个pdf中获取相同的conent,如果我正在做回声,那么显示第2和第3个pdf没有内容
File structure :
application
controllers
generatetemplate.php
libraries
common.php
html2pdf
html2pdf.php
template.php
common.php :
function print_content($customerdata){
$this->load->library('/html2pdf/html2pdf');
$template_config=$this->config->item('template');
ob_start();
require_once($template_config.'template.php'); //
$content = ob_get_contents();
ob_clean();
$content = str_replace("<CUSTOMER_ADDRESS>",$CUSTOMER_ADDRESS,$content);
$this->CI->html2pdf->pdf->SetDisplayMode('fullpage');
$this->CI->html2pdf->writeHTML($content);
$this->CI->html2pdf->Output($download_path,"F");
}
generatetemplate.php
function __construct() {
parent::__construct();
$this->load->library("common");
$this->load->library('html2pdf');
}
function get_customer_data(){
$this->db->order_by("id","DESC");
$this->db->where('id IN (1,2,3)');
$query = $this->db->get("customers")->result_array();
foreach($query as $key=>$accountdata){
$this->common->print_content($accountdata);
}
}
Run Code Online (Sandbox Code Playgroud)
任何帮助和想法将不胜感激.
Lua中如何用分号分割字符串?
local destination_number="2233334;555555;12321315;2343242"
Run Code Online (Sandbox Code Playgroud)
在这里我们可以看到分号(;)多次出现,但我只需要在第一次出现之前从上面的字符串输出。
尝试过的代码:
if string.match(destination_number, ";") then
for token in string.gmatch(destination_number, "([^;]+),%s*") do
custom_destination[i] = token
i = i + 1
end
end
Run Code Online (Sandbox Code Playgroud)
输出 :
2233334
Run Code Online (Sandbox Code Playgroud)
我已经尝试过上面的代码,但对于 Lua 脚本来说是新手,所以无法获得确切的语法。
如何将最小长度的验证添加到文本框并显示自定义错误消息?
我想验证以下内容:
这是弹出模板的代码.模板中指定的最小长度不起作用,但maxlength工作正常.
<script id="popup_editor" type="text/x-kendo-template">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<label for="UserName"><b>UserName*</b></label>
</td>
<td>
<div class="control-row">
<input type="text"
name="UserName"
id="UserName"
class="k-input k-textbox"
required
**minLength**="6"
maxlength="8"
pattern="[a-zA-Z0-9]+"
validationMessage="Please enter username"/>
<span class="k-invalid-msg" data-for="UserName" ></span>
</div>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
<div>
<label for="Password"><b>Password*</b></label>
</div>
</td>
<td>
<div class="k-edit-label">
<input type="password"
id="Password"
name="Password"
class="k-input k-textbox"required
validationMessage="Please enter Password"/>
<span class="k-invalid-msg" data-for="Password"></span>
</div>
</td>
<td>
<div>
<label for="ConfirmPassword" style=""><b>Confirm Password</b></label>
</div>
</td>
<td>
<div class="k-edit-label">
<input type="password"
id="ConfirmPassword" …Run Code Online (Sandbox Code Playgroud) 我想从字符串中删除点。例如
242.701000393 = 242701000393
Run Code Online (Sandbox Code Playgroud)
我尝试过下面的代码,在某些情况下工作正常。
string.gsub("242.701000393", "%.", "")
Run Code Online (Sandbox Code Playgroud)
同样,我已经尝试过上述功能100999212.707000393。但它不起作用。
我是 lua 的新手。我想在每种情况下都从字符串中删除 .(dot) 。
分享你的想法,因为我不知道如何实现它。
按照我的逻辑如下所示
如果可能的话分享它的解决方案。
提前致谢。
代码 :
local destination_number =100999212.707000393
destination_number = string.gsub(destination_number, "%.", "")
print(destination_number)
Run Code Online (Sandbox Code Playgroud)
输出 :100999212707
预期输出:100999212707000393