<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      最近在寫代碼時,發現代碼報錯,原來在spire.pdf繪制表格的時候,如果某個字段的內容超過一定的長度就會出現index and length must refer to a location within the string的報錯

      PdfGrid grid = new PdfGrid();

      //設置單元格邊距和表格默認字體
      grid.Style.CellPadding = new PdfPaddings(1, 1, 1, 1);

      Font font = new Font("Arial", 8, FontStyle.Regular, GraphicsUnit.Point, 1, true);
      grid.Style.Font = new PdfTrueTypeFont(new Font("Arial Unicode MS", 8f), true);
      //10列的表格
      grid.Columns.Add(11);
      //設置列寬
      foreach (PdfGridColumn col in grid.Columns)
      {
          col.Width = 45f;

      PdfPageBase page = sec.Pages.Add();  

       

      grid.Draw(page, new PointF(0, y));
      當表格中某一列內容出現多種字符的時候,會出現bug

      foreach (PdfGridColumn col in grid.Columns)
      {
         // col.Width = 45f;

       row1 = grid.Rows.Add();
       row1.Cells[0].Value = minMonthAssCode.Substring(0, 4) + "-" + minMonthAssCode.Substring(4, 2);
       row1.Cells[0].StringFormat = new PdfStringFormat(PdfTextAlignment.Center);
       row1.Cells[0].Style.BackgroundBrush = PdfBrushes.White;
       string voucherDesc = drV["voucher_desc"].ToString();
       row1.Cells[1].Value = voucherDesc; //voucherDesc 這個變量如果出現多種字符就容易報錯
       row1.Cells[1].StringFormat = new PdfStringFormat(PdfTextAlignment.Center);
       row1.Cells[1].Style.BackgroundBrush = PdfBrushes.White;

       row1.Cells[2].ColumnSpan = 2;
       row1.Cells[2].Value = "期初余額";
       row1.Cells[2].StringFormat = new PdfStringFormat(PdfTextAlignment.Left);
       row1.Cells[2].Style.BackgroundBrush = PdfBrushes.White;

       row1.Cells[4].Value = " ";
       row1.Cells[4].ColumnSpan = 2;
       row1.Cells[4].StringFormat = new PdfStringFormat(PdfTextAlignment.Center);
       row1.Cells[4].Style.BackgroundBrush = PdfBrushes.White;

       row1.Cells[6].Value = " ";
       row1.Cells[6].ColumnSpan = 2;
       row1.Cells[6].StringFormat = new PdfStringFormat(PdfTextAlignment.Center);
       row1.Cells[6].Style.BackgroundBrush = PdfBrushes.White;

       row1.Cells[8].Value = amt_begin_dir;
       row1.Cells[8].StringFormat = new PdfStringFormat(PdfTextAlignment.Center);
       row1.Cells[8].Style.BackgroundBrush = PdfBrushes.White;

       row1.Cells[9].Value = (amt_begin_dir == "借" ? amt_begin_dr.ToString("n2") : amt_begin_dir == "貸" ? amt_begin_cr.ToString("n2") : " ");
       row1.Cells[9].ColumnSpan = 2;
       row1.Cells[9].StringFormat = new PdfStringFormat(PdfTextAlignment.Right);
       row1.Cells[9].Style.BackgroundBrush = PdfBrushes.White;

      經過幾天調試發現,這個指定列寬導致上面的問題出現,注釋后就再也沒報錯了。懷疑這個spire.pdf 在計算列寬的時候,自動切割出錯。因為我的內容里面包含多種字符,比如漢字,特殊字符,全角半角的大小括號。所幸終于解決了。

       

      posted on 2025-07-24 17:12  woody.wu  閱讀(10)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 灵武市| 人妻出轨av中文字幕| 最新国产精品中文字幕| 最新亚洲春色av无码专区| 国产稚嫩高中生呻吟激情在线视频 | 国产欧美另类精品久久久 | 成人性生交大片免费看中文| 欧美成人精品三级网站视频| 97久久精品人人做人人爽| 日韩中文字幕人妻精品| 成人免费xxxxx在线观看| 疯狂做受xxxx高潮欧美日本| 一色桃子中出欲求不满人妻| 亚洲区激情区无码区日韩区| 亚洲av第三区国产精品| 草草浮力影院| 国产午夜一区二区在线观看| 丝袜美腿诱惑之亚洲综合网| 国产精品久久久久久影视| 中文字幕国产精品自拍| 在线天堂www在线| 91一区二区三区蜜桃臀| 日韩精品一区二区三区激情| 中国美女a级毛片| 国产美女裸身网站免费观看视频 | 亚洲日本乱码在线观看| 人妻少妇偷人一区二区| 成人国产亚洲精品天堂av| 玩弄丰满少妇人妻视频| 免费看成人欧美片爱潮app| 亚洲一级片一区二区三区| 国产精品剧情亚洲二区| 久久精品国产中文字幕| 国产亚洲精品超碰热| 99久久亚洲综合精品成人| 中文字幕日韩精品人妻| 国产男女黄视频在线观看| 秋霞在线观看片无码免费不卡| 四虎国产精品永久入口| 一道本AV免费不卡播放| 亚洲永久精品ww47永久入口|