我想在报告中显示一个数字,但是我只想显示任何小数点(如果它们存在且我只想显示1个小数空格).
例如,如果数字是12,那么我想显示12
如果数字是12.1那么我想显示12.1
如果数字是12.11那么我想显示12.1
我使用以下代码将pdf文件发送回用户.这在我的电脑和我们所有的测试电脑上工作正常.但是用户抱怨文档已损坏.当我查看记事本中发回的pdf文件时,我可以在二进制信息后看到一些HTML.
protected void btnGetFile_Click(object sender, EventArgs e)
{
string title = "DischargeSummary.pdf";
string contentType = "application/pdf";
byte[] documentBytes = GetDoc(DocID);
Response.Clear();
Response.ContentType = contentType;
Response.AddHeader("content-disposition", "attachment;filename=" + title);
Response.BinaryWrite(documentBytes);
}
Run Code Online (Sandbox Code Playgroud)