我在我的 Web 应用程序(ASP.NET Core 2)中使用PDFsharp 1.50rc2来生成 PDF。我已经按照PDFsharp 站点上的示例进行操作。但是生成它时遇到了问题,可能与 System.Drawing 中的 FontFamily 有关。没有把握。下面是我生成PDF的代码。
using PdfSharp.Pdf;
using PdfSharp.Drawing;
namespace WebApp.Controllers
{
public class HomeController : Controller {
public IActionResult Index()
{
// creating the PDF
CreatePDF();
return View();
}
public void CreatePDF()
{
// Create a new PDF document
PdfDocument document = new PdfDocument();
document.Info.Title = "Created with PDFsharp";
// Create an empty page
PdfPage page = document.AddPage();
// Get an XGraphics object for drawing
XGraphics gfx = …Run Code Online (Sandbox Code Playgroud) 我在asp.net领域非常棒.所以我的问题可能在互联网的任何地方都得到了解答,但我们都不了解流程创建.这是个问题.
我正在尝试创建简单的"网站项目",当该网站启动时,如果该表尚不存在,它应该在数据库内创建所有必要的身份表.然后我将在表中添加角色并将一个用户设置为此表的超级管理员.
任何人都可以帮我这个或分享关于这个问题的任何链接.
我不知道如何解决这个问题,尝试了一整天但没有成功修复分页。我正在使用 jQuery 数据表,为了显示我的大量数据,我正在使用服务器端。
作为测试,仅调用表中的 10 行数据。然后在传递到表之前,我使用此解决方案重组了dataSrc内的数据。表格显示成功,但分页和筛选器显示不正确。
任何人都可以帮忙这个吗?
下面是我的代码。
阿贾克斯
$('#example').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
type: "POST",
contentType: "application/json; charset=utf-8",
url: "datatables.aspx/GetData",
'data': function (data) {
return JSON.stringify(data);
},
"dataSrc": function (data) {
var json = $.parseJSON(data.d);
var myData = {};
myData.draw = parseInt(json.otherData[0].draw);
myData.recordsTotal = parseInt(json.otherData[0].recordsTotal);
myData.recordsFiltered = parseInt(json.otherData[0].recordsFiltered);
myData.data = json.searchData;
return myData.data;
}
},
"columns": [
{ "data": "Username" }
]
}
});
Run Code Online (Sandbox Code Playgroud)
C#
[WebMethod]
[ScriptMethod(UseHttpGet = false)]
public static string GetData(int draw, …Run Code Online (Sandbox Code Playgroud) 单击导出按钮后,我尝试动态更改文件名并更改其他变量。但似乎新版本在 button.html5.js 中出现了问题。谁能帮我解决这个问题。这是错误图像和我的代码链接。
buttons: [{
extend: 'excel',
text: 'Excel',
action: function (e, dt, node, config) {
exportExtension = 'Excel';
$.fn.DataTable.ext.buttons.excelHtml5.action(e, dt, node, config);
}
}]
Run Code Online (Sandbox Code Playgroud)
我尝试查询在其他服务器中组合3表的结果.我的查询正在运行,但需要很长时间才能得到结果(2分钟).任何人都可以帮我重构查询,使其快速.我不能使用链接服务器.以下是我的查询:
DECLARE @min_price decimal(38,4);
DECLARE @max_price decimal(38,4);
SET @min_price = 1.045;
SET @max_price = 13.855;
SELECT
Image.filename,
Sender.uploder_name,
Receiver.company_name,
Image.price_estimate,
Image.size
FROM
OPENROWSET('SQLNCLI', 'DRIVER={SQL Server};SERVER=ServerName;UID=userID;PWD=password', 'SELECT * from dbName.dbo.image') Image
INNER JOIN OPENROWSET('SQLNCLI', 'DRIVER={SQL Server};SERVER=ServerName;UID=userID;PWD=password', 'SELECT * from dbName.dbo.sender') Sender
ON Image.sender_username = Sender.username
INNER JOIN OPENROWSET('SQLNCLI', 'DRIVER={SQL Server};SERVER=ServerName;UID=userID;PWD=password', 'SELECT * from dbName.dbo.receiver') Receiver
ON Image.receiver_username = Receiver.username
WHERE
Receiver.min_price >= @min_price AND Receiver.max_price <= @max_price
Run Code Online (Sandbox Code Playgroud)
我怀疑使用OPENROWSET并且连接几个表是导致这个慢的原因,因为我使用这个方法只调用1个表,查询结果相当快.请帮忙.
我得到如下列表
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
如何使列表安排像这样.
1 2 5 6 9 10
3 4 7 8 11 ....etc
Run Code Online (Sandbox Code Playgroud)
要么
1 3 5 7 9 11
2 4 6 8 10 .... etc
Run Code Online (Sandbox Code Playgroud)
我需要这种安排,因为我使用角度ng-repeat,所以我需要每个数字都有相同的元素.我不介意你们是否使用其他元素给出答案,但每个数字必须具有相同的元素.谢谢
p/s:滚动时数字会增加,就像无限滚动一样.
asp.net ×2
c# ×2
datatables ×2
ajax ×1
asp.net-core ×1
css ×1
css3 ×1
html ×1
html5 ×1
jquery ×1
pdf ×1
pdfsharp ×1
sql ×1
sql-server ×1